tags:

views:

25

answers:

1

Hi, I have a JS file that is dependent to another Js file. this Js file is something like this (Common.js)

//Some codes here
window.onload = PageLoad;                                   
//some codes here

and then I implement PageLoad function in another Js file. ( I do this because every page has its own PageLoad implementation)

and I Load these files like this on my Main.aspx :

`<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">`
`<\script language="javascript" type="text/javascript" src="PagesJS/pgeMain.js"></script>`
`<\script language="javascript" type="text/javascript" src="JS/Common.js"></script>`  
...
...
`</asp:Content>`

Every thing works fine on local but when I deploy it, sometimes I get PageLoad undefined Error!

Can any one tells me what is wrong with this?

Thanks. Aidin

A: 

Thanks Marcel,

actually Most of the times it works fine. but in some computers usually with IE8 the problem reveals(just some times!).I aslo have this problem in other versio of IE but seldom! I do not know if all my scripts loads exactly in the same order as I write them or not!

Aidin
Sorry I did not know how to make a reply on your comment. so I made an answer!
Aidin
You should be able to add a comment to your own question, even with 1 rep. Also, put an at-sign in front of my first name, so I'm notified (see [How do comment replies work?](http://meta.stackoverflow.com/questions/43019/how-do-comment-replies-work)). You can also edit your own question and add new information (but I'm not notified of that, so it's just luck if and when I come back to your question, like now). And all scripts loaded using `<script>` elements *should* be loaded in that order (apart from cases when using some special attributes). Look at the generated HTML source (or post that).
Marcel Korpel