<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Script include syntax in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/script-include-syntax/m-p/2591041#M1008101</link>
    <description>&lt;P&gt;The above line is a class that is been extended just like we do in java which follows object oriented approach.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;classname&amp;gt;.prototype = object.extendobject(extending class),{ your script&amp;nbsp;&lt;/P&gt;&lt;P&gt;Usually by default we extend AbstractAjaxProcessor which is used for GlideAjax.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For other&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;var&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;answer&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;=&lt;/SPAN&gt;&lt;SPAN class=""&gt;response&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;responseXML&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;documentElement&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;getAttribute&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;"answer"&lt;/SPAN&gt;&lt;SPAN class=""&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Let us assume we have a function in Script Include :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;demofunction: function () {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var element =&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;this.getParameter('sysparm_parameter');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;return 'Hi, This is bind with answer atrribute';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Now in client script &amp;nbsp; -&lt;/P&gt;&lt;P&gt;function myCallBack(response) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var answer =&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;response&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;responseXML&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;documentElement&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;getAttribute&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;"answer"&lt;/SPAN&gt;&lt;SPAN class=""&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;alert(answer); // Output &amp;nbsp; "&lt;SPAN&gt;Hi, This is bind with answer atrribute&lt;/SPAN&gt;"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;Here "response" is an XML document which contains an attribute "answer" and the value returned from the demofunction binded with the answer attribute.&lt;/P&gt;&lt;P&gt;So&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;response&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;responseXML&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;documentElement&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;getAttribute&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;"answer"&lt;/SPAN&gt;&lt;SPAN class=""&gt;) gives us the value returned from the script include function.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P&gt;&lt;STRONG&gt;Please Mark helpful or correct Answer , If it solves your query.&lt;/STRONG&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Sat, 17 Jun 2023 13:28:37 GMT</pubDate>
    <dc:creator>Community Alums</dc:creator>
    <dc:date>2023-06-17T13:28:37Z</dc:date>
    <item>
      <title>Script include syntax</title>
      <link>https://www.servicenow.com/community/developer-forum/script-include-syntax/m-p/2591036#M1008099</link>
      <description>&lt;P&gt;&lt;FONT color="#000000"&gt;Could you please explain me with more details, what does the below code lines (&lt;FONT color="#FF0000"&gt;Red&lt;/FONT&gt; and &lt;U&gt;underlined&lt;/U&gt;) does.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;var MyFavoritesAjax = Class.create();&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#FF0000"&gt;&lt;U&gt;MyFavoritesAjax.prototype = Object.extendsObject(AbstractAjaxProcessor&lt;/U&gt;,&lt;/FONT&gt; {&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;getFavorites: function() {&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;},&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;U&gt;type:"MyFavoritesAjax"&lt;/U&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&amp;nbsp;});&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Client script:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;SPAN&gt;function callback(response) {&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;U&gt;var result = response.responseXML.getElementsByTagName("result");&lt;/U&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 17 Jun 2023 12:18:14 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/script-include-syntax/m-p/2591036#M1008099</guid>
      <dc:creator>BALAJI K R</dc:creator>
      <dc:date>2023-06-17T12:18:14Z</dc:date>
    </item>
    <item>
      <title>Re: Script include syntax</title>
      <link>https://www.servicenow.com/community/developer-forum/script-include-syntax/m-p/2591041#M1008101</link>
      <description>&lt;P&gt;The above line is a class that is been extended just like we do in java which follows object oriented approach.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;classname&amp;gt;.prototype = object.extendobject(extending class),{ your script&amp;nbsp;&lt;/P&gt;&lt;P&gt;Usually by default we extend AbstractAjaxProcessor which is used for GlideAjax.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For other&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;var&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;answer&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;=&lt;/SPAN&gt;&lt;SPAN class=""&gt;response&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;responseXML&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;documentElement&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;getAttribute&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;"answer"&lt;/SPAN&gt;&lt;SPAN class=""&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Let us assume we have a function in Script Include :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;demofunction: function () {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var element =&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;this.getParameter('sysparm_parameter');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;return 'Hi, This is bind with answer atrribute';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Now in client script &amp;nbsp; -&lt;/P&gt;&lt;P&gt;function myCallBack(response) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var answer =&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;response&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;responseXML&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;documentElement&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;getAttribute&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;"answer"&lt;/SPAN&gt;&lt;SPAN class=""&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;alert(answer); // Output &amp;nbsp; "&lt;SPAN&gt;Hi, This is bind with answer atrribute&lt;/SPAN&gt;"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;Here "response" is an XML document which contains an attribute "answer" and the value returned from the demofunction binded with the answer attribute.&lt;/P&gt;&lt;P&gt;So&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;response&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;responseXML&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;documentElement&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;getAttribute&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;"answer"&lt;/SPAN&gt;&lt;SPAN class=""&gt;) gives us the value returned from the script include function.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P&gt;&lt;STRONG&gt;Please Mark helpful or correct Answer , If it solves your query.&lt;/STRONG&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 17 Jun 2023 13:28:37 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/script-include-syntax/m-p/2591041#M1008101</guid>
      <dc:creator>Community Alums</dc:creator>
      <dc:date>2023-06-17T13:28:37Z</dc:date>
    </item>
    <item>
      <title>Re: Script include syntax</title>
      <link>https://www.servicenow.com/community/developer-forum/script-include-syntax/m-p/2591043#M1008102</link>
      <description>&lt;P&gt;Thanks a lot , also could me explain about in&amp;nbsp;&lt;U&gt;type:"MyFavoritesAjax"&lt;/U&gt; GlideAjax&lt;/P&gt;</description>
      <pubDate>Sat, 17 Jun 2023 13:42:56 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/script-include-syntax/m-p/2591043#M1008102</guid>
      <dc:creator>BALAJI K R</dc:creator>
      <dc:date>2023-06-17T13:42:56Z</dc:date>
    </item>
    <item>
      <title>Re: Script include syntax</title>
      <link>https://www.servicenow.com/community/developer-forum/script-include-syntax/m-p/2591052#M1008107</link>
      <description>&lt;P&gt;It is the property used by servicenow as a part of default syntax, as servicenow is build on java.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Mehta_0-1687011138401.png" style="width: 999px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/268124i7B407F488A86AE21/image-size/large?v=v2&amp;amp;px=999" role="button" title="Mehta_0-1687011138401.png" alt="Mehta_0-1687011138401.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please mark it as correct answer if it resolve your query .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 17 Jun 2023 14:13:00 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/script-include-syntax/m-p/2591052#M1008107</guid>
      <dc:creator>Community Alums</dc:creator>
      <dc:date>2023-06-17T14:13:00Z</dc:date>
    </item>
  </channel>
</rss>

