function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Ram Shiva KumarRam Shiva Kumar 

Not able to execute the javascritp

Hi iam tring to execute the java script file . i have uploaded the java script file in staticresouces  and impoted that file in to the VFpage. this is my code,


<apex:page>

<apex:pageBlock>


<apex:form>

<!-- Ext JS -->
<head>
   <apex:includeScript value="{!$Resource.jsss}"/> 
   
   </head>
    
</apex:form>

</apex:pageBlock>

</apex:page>

so please sugget me any one.

Regards,
Siva
Best Answer chosen by Ram Shiva Kumar
Magesh Mani YadavMagesh Mani Yadav
Hi ram,

You need to call that function in your visualforce page
like this
<script type="text/javascript">
popup();
</script>
</apex:page>

 

All Answers

Aakanksha SinghAakanksha Singh
Hi,
You don't need to add head tag in the page. your code must be like,
<apex:page>
<!--In case you uploaded just the file-->
<apex:includeScript value="{!URLFOR($Resource.STATIC_RESOURCE_NAME,'FILENAME')}"/>
<!--In case you uploaded file in zip-file-->
<apex:includeScript value="{!URLFOR($Resource.STATIC_RESOURCE_NAME,'PATH')}"/>  
<apex:pageBlock>
<apex:form>

    
</apex:form>
</apex:pageBlock>
</apex:page>

Thanks
Ram Shiva KumarRam Shiva Kumar
Hi Aakankha,

Still iam not getting the pop up iam using the code below,

<apex:page>
<!--In case you uploaded just the file-->
<apex:includeScript value="{!URLFOR($Resource.jsss,'siva')}"/>
<!--In case you uploaded file in zip-file-->
  
<apex:pageBlock>
<apex:form>

    
</apex:form>
</apex:pageBlock>
</apex:page>

Regards,
Siva.
Aakanksha SinghAakanksha Singh
can you send your javascript code??
Ram Shiva KumarRam Shiva Kumar
Hi,
This is the file.

function popup() { alert("Hello World") }

Thanks,
Siva
Magesh Mani YadavMagesh Mani Yadav
Hi ram,

You need to call that function in your visualforce page
like this
<script type="text/javascript">
popup();
</script>
</apex:page>

 
This was selected as the best answer
Ram Shiva KumarRam Shiva Kumar
Thanks Mani  and Aakanksha for the help.

Regards,
Siva