You need to sign in to do that
Don't have an account?
include javascript files from static resource on detail button click
Hi...
How to include static resource files in the javascript using "Requirescript", please let me know.....
For Ex. On detail click files from my static resource, i have used following but it gives me error.......
On detail buton click below javascript is called to display popup...but not working
{!REQUIRESCRIPT("/soap/ajax/13.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/13.0/apex.js")}
{!requireScript("/js/jquery-ui-1.7.2.custom.min.js")}
{!requireScript("/js/jquery-1.3.2.min.js")}
{!requireScript("development-bundle/ui/ui.core.js")}
{!requireScript("/development-bundle/ui/ui.dialog.js")}
{!requireScript("/development-bundle/ui/ui.draggable.js.core.js")}
{!requireScript("/development-bundle/themes/base/ui.all.css")}
document.body.innerHTML +="";
document.body.innerHTML += "<link rel=\"stylesheet\" type=\"text/css\" href=\"http://jqueryui.com/themes/base/jquery.ui.all.css\"><link rel=\"stylesheet\" type=\"text/css\" href=\"http://jqueryui.com/demos/demos.css\"><div id='dialog-message' title='Pubish Description'>hi1234</div>";
$(function() {
// a workaround for a flaw in the demo system (http://dev.jqueryui.com/ticket/4375), ignore!
$("#dialog-message").dialog("destroy");
$("#dialog-message").dialog( "moveToTop" )
$("#dialog-message").dialog( "enable" )
$("#dialog-message").dialog({
modal: true,
width: 500,
buttons: {
Save: function() {
alert("hi123");
$(this).dialog('close');
}
}
});
});
In my opinion, you have used wrong javascript namespace in your code.
Try using :
{!requireScript("http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js")}
{!requireScript("http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js")}
in place of :
{!requireScript("/js/jquery-ui-1.7.2.custom.min.js")}
{!requireScript("/js/jquery-1.3.2.min.js")}
Hope this helps.