My best guess is:
I'm pretty sure that ../../Scripts will fail if an url is just a little different from www.domain.com/app_path/controller/action
../ joined together with url rewrite is NOT your friend. ../ is handling the path relative to the current url.
Imagine this:
- If your current url is
http://www.example.com/app_path/home/index/, then ../../Scripts/jquery-ui-1.10.2.min.js will translate to: http://www.example.com/app_path/Scripts/jquery-ui-1.10.2.min.js which is good. But if your url is: http://www.example.com/app_path/home/ than the script will be http://www.example.com/Scripts/jquery-ui-1.10.2.min.js which is even outside your application.
ASP.NET has a way of handling application relative url-s:
<link href="@Url.Content("~/Content/themes/base/jquery-ui.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Scripts/jquery-1.9.1.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery-ui-1.10.2.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/TableCreationScript.js")"></script>
<script>
$(function () {
$(document).tooltip();
});
</script>
EDIT:
After reading the comments now I'm pretty sure the url to the script file is wrong in some way. You need to check if the javascript files are referenced and found correctly:
Do the following:
- Open the html source of your document in a decent browser.
- Check where the script URL is pointing to. (For example in firefox you can click on the urls in the source, and you can view the pointed site's source.
- In your case clicking the script's url needs to take you to the source of the script file!
- If it shows the source of a html file you are quite possibly looking at the source of a
404 Not Found
Or you can just:
- Check the network tab in chrome developer tools. You should be able to see if everything loaded correctly.
console.log(window.jQuery.ui);what does it returnTableCreationScript? Does it re-invoke jQuery? if it does, it will destroy the previous objects attachments, and thussly, theuiobject.