Please tell me where can I write javascript for a sharepoint site and what are the possible ways to write a javascript code for a sharepoint site.
Thanks, Bhanu
|
Please tell me where can I write javascript for a sharepoint site and what are the possible ways to write a javascript code for a sharepoint site. Thanks, Bhanu |
|||
|
|
|
Approach 1 : You can define your java script code in code behind file and than you can register it using Page.IsClientScriptBlockRegistered as shown below.
Once you created your script you can later use following code in "OnPreRender" method.
Approach2: You can place ContentEditorWebPart on the page and write Javascript code there. Approach3: Create your javascript file and put it in _Layouts folder. Once you have your javascript file you can modify your master page and register tag as shown below.
|
|||
|
|
|
It can be even easier than the other answers: You can simply put the JavaScript into a Content Editor Web Part. It all depends on what your goals are, e.g., how widely you want to use the script, what it does, etc. |
|||
|
|
|
If you just want to add some JavaScript to the existing user interface without having to modify your existing pages or solution then check out our free Muhimbi SharePoint Infuser tool. |
|||||
|
|
Here is a question that I asked on the matter Click Here As you will see I also made use of a CEWP....... |
|||
|
|