You need to sign in to do that
Don't have an account?
Anjaneylu
what is the use of SRC attribute in SCRIPT tag in visualforce page..
hi
what is the use of SRC attribute in SCRIPT tag in visualforce page.. ?
here i have seen this piece of code for creating account record through visualforce page.
why he used this attribute.
here example is :
please help me
Thanks in Advance
Anji reddy
what is the use of SRC attribute in SCRIPT tag in visualforce page.. ?
here i have seen this piece of code for creating account record through visualforce page.
why he used this attribute.
here example is :
<apex:page id="page"> <script src="/soap/ajax/36.0/connection.js" type="text/javascript"> </script> <script> function callAjax(){ sforce.connection.sessionid = '{!$Api.session_id}'; var accountnam = document.getElementById('page:fm:accountname').value; var indust = document.getElementById('page:fm:accountindustry').value; var account1 = new sforce.sobject("account"); account1.name = accountnam; account1.industry = indust; var result = sforce.connection.create([account1]); document.getElementById('page:fm:reslt').innerhtml = result; } </script> <apex:form id="fm"> Account name : <apex:inputText id="accountname"/><br/> Industry : <apex:inputText id="accountIndustry"/><br/> <apex:commandButton value="Call ajax" oncomplete="callAjax()" /> <apex:outputLabel id="reslt" /> </apex:form> </apex:page>
please help me
Thanks in Advance
Anji reddy
The src attribute specifies the URL of an external script file.
If you want to run the same JavaScript on several VF Pages, you should create an external JavaScript file, instead of writing the same script over and over again.
Save the script file with a .js extension, and then refer to it using the src attribute in the <script> tag.
To see the source code of the .js file, check:
https://ap1.salesforce.com/soap/ajax/36.0/connection.js
Kind Regards,
Sourav
All Answers
what is the use of this line..
The src attribute specifies the URL of an external script file.
If you want to run the same JavaScript on several VF Pages, you should create an external JavaScript file, instead of writing the same script over and over again.
Save the script file with a .js extension, and then refer to it using the src attribute in the <script> tag.
To see the source code of the .js file, check:
https://ap1.salesforce.com/soap/ajax/36.0/connection.js
Kind Regards,
Sourav
initially i have not written any javascript files. but in the code mentioned that src = "soap/ajax/36.0/connection.js"
from where we are getting this..
thanks in advance..
anji
It's an in-built code developed by Salesforce.
Kind Regards,
Sourav.
but my above code is not working properly..
can you help me.
here i'm unable to save the account record..
thanks
anji