+ Start a Discussion
prabhutumprabhutum 

How to initialize AJAX toolkit in Visual Force page

Hello,

 

When I try to initialize the AJAX toolkit in javascript of a visual force page, I get error, "Function REQUIRESCRIPT may not be used in this type of formula." What am I doing wrong?

 

<script language="javascript">

  {!requireScript("/soap/ajax/14.0/connection.js")};

  {!requireScript("/soap/ajax/14.0/apex.js")};

 

  function openOBPPopUp(){ 

        var retVal = sforce.apex.execute("OBP_WebService_Wrapper","call_OBP_WS",{serverURL:"{!$Api.Enterprise_Server_URL_140}"});

  }

</script>

 

Thanks!

Pr@sh...

 

 

Message Edited by prabhutum on 05-20-2009 12:14 PM
Best Answer chosen by Admin (Salesforce Developers) 
prabhutumprabhutum

Figured it...

 

<apex:includeScript value="/soap/ajax/15.0/connection.js"/>

<apex:includeScript value="/soap/ajax/15.0/apex.js"/>