I have a sandboxed sharepoint project, in which I have created a module, put jQuery there and referenced it from my webpart's ascx page like this:
<head>
<script src="/Content/jquery-1.7.2.min.js" type="text/javascript"></script>
</head>
The thing seems to load properly and the scripts work - the thing is when I'm setting some personalizable properties in the webpart's options, its supposed to fire a jquery script from codebehind, like this:
protected override void CreateChildControls()
{
base.CreateChildControls();
Controls.Add(
new LiteralControl("<script language=\"javascript\" type=\"text/javascript\">jQuery(document).ready(setClockOffset($, " + ClockTimeZone9 + ",\"" + ClockTimeZone8 + "\"));</script>"));
}
And this gives me the following error:
Uncaught ReferenceError: jQuery is not defined
It seems like LiteralControl adds the markup as the first element inside head, instead of possibly adding it after the jquery reference. What would be the best way to approach an issue like that?
