Sunday, March 11, 2012

Atlas not working with external JS files

Hey Thanks Garbin,

I will try that will let you know.
Once again thanks


Hi,

1. try to add a reference to your js file in the <scripts> section of the ScriptManager control.

 <atlas:ScriptManager ID="sm" runat="server">
<Scripts>
<atlas:ScriptReference Path="PathToJsFile" />
</Scripts>
</atlas:ScriptManager>

2. I see from your code that you are hooking the onload event to a custom function. The Atlas framework already hooks up that event and raises its load event when all the initialization stuff is done. My suggestion is to call your startList function from there. To do this, remove the statement window.onload = startList from your file, and then add this xml-script section to your page:

<script type="text/xml-script">
<page>
<components>
<application load="startList" />
</components>
</page>
</script>


Garbin:

Hi,

1. try to add a reference to your js file in the <scripts> section of the ScriptManager control.

 <atlas:ScriptManager ID="sm" runat="server">
<Scripts>
<atlas:ScriptReference Path="PathToJsFile" />
</Scripts>
</atlas:ScriptManager>

2. I see from your code that you are hooking the onload event to a custom function. The Atlas framework already hooks up that event and raises its load event when all the initialization stuff is done. My suggestion is to call your startList function from there. To do this, remove the statement window.onload = startList from your file, and then add this xml-script section to your page:

<script type="text/xml-script">
<page>
<components>
<application load="startList" />
</components>
</page>
</script>

Hey Garbin,

I tried what you recommended above and no luck. Still the DropDownMenus do not work and atlas does not work also. Any other suggestions. I put the code you recommened in my Master Page.


I have just encountered this issue and was flabbergasted.

I broke things down to bare minimums and when that didn't work on my site, I went and started working with the templated Atlas website.

The script was simple, firing an alert which wasn't working.

In the Atlas template site, it was working, so I added a Master page and set the aspx page to use it.

I then placed the the ScriptManager in the Masterpage and added the external script as a custom ScriptReference.

It stopped working.

I don't know the cause, but it appears to be a problem when using external scripts in MasterPages.

I think this is significant enough to warrant that Atlas head honchos to take a gander.

Nathan


Thanks for the info... If I ever see a Atlas Guru, I am going to slap this post inthere face and tell them to go fix it.


Err, I'm thinking the slapping isn't needed unless it's just for fun. Particularly since it's seeming to work now for me.

I got back into deving now that the heat has passed and it's no longer 90+ degrees in my room and I saw the July CTP is out, put that on and things are kosher now.

Nathan


vindicator:

Particularly since it's seeming to work now for me.

So... what was the fix? Installing the July CTP?


That was the only change I made.

Nathan


vindicator:

Err, I'm thinking the slapping isn't needed unless it's just for fun. Particularly since it's seeming to work now for me.

I got back into deving now that the heat has passed and it's no longer 90+ degrees in my room and I saw the July CTP is out, put that on and things are kosher now.

Nathan

Hey Nathan,

I am glad that you got yours to work, but in my case NO LUCK. It is still doing the same thing buy not displaying the dynamic dropdown menus. If I remove the Atlas References, and just go back to the old way of include a JS file, then it works like a charm.

No luck...Crying


I need help with this too... I'm using April CTP and have the ScriptManager in my MasterPage with no luck.

If anyone has a solution/workaraound for this, do let us know, please!


Just write your script on the page load event.

eome:

Just write your script on the page load event.

What script are you talking about? My entire JavaScript Code or the Onload Funtion I am calling using "window.onload". And on the pageload event on server side?

Thanks.

No comments:

Post a Comment