<rdf:RDF
    xmlns:s='http://snipsnap.org/rdf/snip-schema#'
    xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
    xml:base='http://wiki.marandcustomsolutions.com/rdf'>
    <s:Snip rdf:about='http://wiki.marandcustomsolutions.com/rdf#Development/Javascript'
         s:name='Development/Javascript'
         s:cUser='mpecher'
         s:oUser=''
         s:mUser='mpecher'>
        <s:content>This section is for Javascript related items, that are often used\\&#xD;&#xA;&#xD;&#xA;1.1.1 1. &amp;lt;A&amp;gt; (Link) to trigger Javascript functionality&#xD;&#xA;{code:html}&#xD;&#xA;&lt;a href=&quot;javascript:void(0)&quot; id=&quot;link_ref&quot; onClick=&quot;javascript:theFunction();&quot;&gt;Link Test&lt;/a&gt;&#xD;&#xA;{code}&#xD;&#xA;1.1.1 2. Confirm before following a link&#xD;&#xA;{code:html}&#xD;&#xA;&lt;a href=&quot;#&quot; onClick=&quot;javascript: return(confirm(&apos;Do you want to proceed&apos;));&quot;&gt;Confirm prior to following link&lt;/a&gt;&#xD;&#xA;{code}&#xD;&#xA;1.1.1 3. Adding inline Javascript to onLoad event of page&#xD;&#xA;This is useful if within a page, javascript needs to be added to the onload event. (Say if inside a Portlet, which doesn&apos;t have its own onload etc):&#xD;&#xA;{code:javascript}&#xD;&#xA;function addToBodyOnload(oFunction) {&#xD;&#xA;    var existingOnload = window.onload;&#xD;&#xA;    window.onload = function () { existingOnload(); oFunction(); }&#xD;&#xA;}&#xD;&#xA;{code}&#xD;&#xA;Usage:&#xD;&#xA;{code}&#xD;&#xA;addToBodyOnload(someFunction);&#xD;&#xA;or&#xD;&#xA;addToBodyOnload(function () { document.getElementById(&quot;mainTable&quot;).focus(); } );&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;1.1.1 4. Radio Buttons / Dynamic Typing Gotchyas&#xD;&#xA;Grapping Radio button from the form. This will return:\\&#xD;&#xA;* an array for &gt; 1 radio button\\&#xD;&#xA;* the radio button element for = 1 radio button\\&#xD;&#xA;Need to ensure this is tested (see below)&#xD;&#xA;{code:html}&#xD;&#xA;var radioButtons = form[&quot;someRadioButtons&quot;];&#xD;&#xA;&#xD;&#xA;if (typeof(radioButtons.length)==&quot;undefined&quot;) {&#xD;&#xA;      //holds the value itself not an array &#xD;&#xA;    &#9;return radioButtons.value;&#xD;&#xA;} else {&#xD;&#xA;  for (var i=0; i &lt; radioButtons.length; i++)  {&#xD;&#xA;    if (radioButtons[i].checked)  {&#xD;&#xA;      return radioButtons[i].value;&#xD;&#xA;    }&#xD;&#xA;  }&#xD;&#xA;}&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;1.1.1 Trimming trailing spaces&#xD;&#xA;To trim spaces use the following regular expression on the String:\\&#xD;&#xA;__/\s+$/g__\\&#xD;&#xA;eg. &#xD;&#xA;{code}document.Login.username.value = document.Login.username.value.replace(/\s+$/g, &apos;&apos;);&#xD;&#xA;{code}&#xD;&#xA;----&#xD;&#xA;1 Sites:&#xD;&#xA;http://www.mattkruse.com/javascript/ \\&#xD;&#xA;http://www.javascriptkit.com/script/script2/timestamp.shtml \\&#xD;&#xA;&#xD;&#xA;{link: Calendar Popup |http://www.mattkruse.com/javascript/calendarpopup/}&#xD;&#xA;&#xD;&#xA;----&#xD;&#xA;1 Rich HTML editors&#xD;&#xA;http://wiki.moxiecode.com&#xD;&#xA;</s:content>
        <s:mTime>2007-12-16 11:14:15.0</s:mTime>
        <s:cTime>2005-08-16 11:17:42.0</s:cTime>
        <s:comments
             rdf:type='http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag'/>
        <s:snipLinks>
            <rdf:Bag>
                <rdf:li rdf:resource='http://wiki.marandcustomsolutions.com/rdf#Development/Javascript/Hide/Show Div'/>
                <rdf:li rdf:resource='#snipsnap-search'/>
                <rdf:li rdf:resource='#snipsnap-index'/>
                <rdf:li rdf:resource='http://wiki.marandcustomsolutions.com/rdf#Development/Javascript/Tab Order For Radio Buttons'/>
                <rdf:li rdf:resource='http://wiki.marandcustomsolutions.com/rdf#Menu Links Examples'/>
                <rdf:li rdf:resource='http://wiki.marandcustomsolutions.com/rdf#Development/Java &amp; J2EE/Spring/Validation'/>
                <rdf:li rdf:resource='http://wiki.marandcustomsolutions.com/rdf#Development/Javascript/'/>
                <rdf:li rdf:resource='http://wiki.marandcustomsolutions.com/rdf#Development/Java &amp; J2EE/Websphere/Portal'/>
                <rdf:li rdf:resource='#Development'/>
                <rdf:li rdf:resource='http://wiki.marandcustomsolutions.com/rdf#Development/Java &amp; J2EE/Spring'/>
                <rdf:li rdf:resource='http://wiki.marandcustomsolutions.com/rdf#Trailer Wiring'/>
                <rdf:li rdf:resource='http://wiki.marandcustomsolutions.com/rdf#Development/Java &amp; J2EE/Websphere'/>
                <rdf:li rdf:resource='http://wiki.marandcustomsolutions.com/rdf#Development/Java &amp; J2EE/Websphere/Portal/'/>
                <rdf:li rdf:resource='http://wiki.marandcustomsolutions.com/rdf#snipsnap-index/'/>
                <rdf:li rdf:resource='http://wiki.marandcustomsolutions.com/rdf#Development/Java &amp; J2EE/Websphere/Java 2 Security'/>
                <rdf:li rdf:resource='#vi'/>
                <rdf:li rdf:resource='http://wiki.marandcustomsolutions.com/rdf#Development/Testing/junit'/>
                <rdf:li rdf:resource='http://wiki.marandcustomsolutions.com/rdf#Development/Java &amp; J2EE/Websphere/Portal/skins'/>
                <rdf:li rdf:resource='http://wiki.marandcustomsolutions.com/rdf#Development/Firefox Extensions'/>
                <rdf:li rdf:resource='http://wiki.marandcustomsolutions.com/rdf#Development/Java &amp; J2EE/Websphere/Portal/Enable jsp recompile for Websphere Portal pages'/>
            </rdf:Bag>
        </s:snipLinks>
        <s:attachments
             rdf:type='http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag'/>
    </s:Snip>
</rdf:RDF>

