Return to Snippet

Revision: 49488
at July 22, 2011 17:04 by ariunbolor


Updated Code
var jqscript=document.createElement('script');jqscript.setAttribute("type","text/javascript");jqscript.setAttribute("src","http://code.jquery.com/jquery-latest.js");document.getElementsByTagName("head")[0].appendChild(jqscript);




/******************************************************************************/



integer face = 4;
string externalJavascript =
"http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js";
default
{
state_entry()
{
string dataURI = "data:text/html," +
"<head><script src='" + externalJavascript + "'></script></head>" +
"<button>Toggle</button>" +
"<p>Hello<br />World</p>" +
"<script>$('button').click(function () " +
"{$('p').slideToggle('slow');});</script>";
llSetPrimMediaParams(face,
[PRIM_MEDIA_CURRENT_URL, dataURI]);
}
}

Revision: 49487
at July 22, 2011 16:59 by ariunbolor


Initial Code
integer face = 4;
string externalJavascript =
"http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js";
default
{
state_entry()
{
string dataURI = "data:text/html," +
"<head><script src='" + externalJavascript + "'></script></head>" +
"<button>Toggle</button>" +
"<p>Hello<br />World</p>" +
"<script>$('button').click(function () " +
"{$('p').slideToggle('slow');});</script>";
llSetPrimMediaParams(face,
[PRIM_MEDIA_CURRENT_URL, dataURI]);
}
}

Initial URL

                                

Initial Description

                                

Initial Title
Calling external JS or JQuery

Initial Tags
js, jquery

Initial Language
JavaScript