This is a migrated thread and some comments may be shown as answers.

AJax and JavaScript References

2 Answers 59 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Dennis
Top achievements
Rank 1
Dennis asked on 06 Feb 2008, 09:50 PM

I am able to create a web page with the RadAjaxManager using the settings to set the specific control to cause the post and the control to receive the results, and it works as expected.

But if I add a JavaScript reference into the body as below, instead of responding to the Ajax request/response, it seems like the page performs a full refresh (you can see the flash). If I add the reference into the header, I receive all kinds of errors in the Resource Scripts.

What is the appropriate method for adding the JavaScript reference so that it works?

<script language="javascript" type="text/javascript" src="Scripts/EventHandlers.js" />

2 Answers, 1 is accepted

Sort by
0
Dennis
Top achievements
Rank 1
answered on 06 Feb 2008, 10:16 PM
I'm not happy with this workaround, but it seems to work in initial testing, but I would like to a have a defnitive answer from Telerik on the issue.

Using inline script at the bottom of the body that reads as follows to dynamically load the script from the client. 

var eventHandlers = document.createElement ("script");

eventHandlers.id =

"Workspace.EventHandlers";

eventHandlers.type =

"text/javascript";

eventHandlers.src=

"Scripts/EventHandlers.js";

document.getElementsByTagName ("head") [0].appendChild (eventHandlers);

0
Accepted
Vlad
Telerik team
answered on 07 Feb 2008, 07:15 AM
Hi Dennis,

You should not use self closing script tags - this will cause rendering issues in IE. You can check this link:

http://webbugtrack.blogspot.com/2007/08/bug-153-self-closing-script-tag-issues.html

Sincerely yours,
Vlad
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Ajax
Asked by
Dennis
Top achievements
Rank 1
Answers by
Dennis
Top achievements
Rank 1
Vlad
Telerik team
Share this question
or