frosty1
asked on
How to add <script /> refs in ajax call
I'm noticing that when i look at my html code from fire fox that if i make ajax call my <script tags /> are removed. Is this standard precedure. How do you then do client side validation.
ie Page1 makes an ajax call and gets the content of Page2 which contains a form.
I'm noticing that Page2 is having its <script /> tags remove. Kill my validation.
ie Page1 makes an ajax call and gets the content of Page2 which contains a form.
I'm noticing that Page2 is having its <script /> tags remove. Kill my validation.
ASKER
thanks, that good info.
Actually i'm using prototype
Here is my function. When form.aspx is render it is minus the <script /> tags. I need this to validate the form on form.aspx
function openOverlay (lat, lng, zoom) {
map.closeInfoWindow();
new Effect.Appear('curtain', { from: 0.0, to: 0.70, duration: 0.20 });
new Effect.Appear('display', { from: 0.0, to: 1.0, duration: 0.20, afterFinish: function () {
new Ajax.Updater('display', '/maps/map1/flagform.aspx? lat=' + lat + '&lng=' + lng + '&zoom=' + zoom, { method: 'get' });
} });
}
Actually i'm using prototype
Here is my function. When form.aspx is render it is minus the <script /> tags. I need this to validate the form on form.aspx
function openOverlay (lat, lng, zoom) {
map.closeInfoWindow();
new Effect.Appear('curtain', { from: 0.0, to: 0.70, duration: 0.20 });
new Effect.Appear('display', { from: 0.0, to: 1.0, duration: 0.20, afterFinish: function () {
new Ajax.Updater('display', '/maps/map1/flagform.aspx?
} });
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
wow , great response.
So as abel saids, you need to part thru evalscript = true.
also, include the script tags in the parent, in my case the validation.js needed to be in the page that called form.
So as abel saids, you need to part thru evalscript = true.
also, include the script tags in the parent, in my case the validation.js needed to be in the page that called form.
> wow , great response.
thx for the compliment. I remember that I was stumbling upon the same issue, about five years ago, and it took me ages to fix it. Then came prototype and the likes of them, making life much easier.
tx for the points,
-- Abel --
thx for the compliment. I remember that I was stumbling upon the same issue, about five years ago, and it took me ages to fix it. Then came prototype and the likes of them, making life much easier.
tx for the points,
-- Abel --
There are several libraries that can help you with this issue. One is Prototype.js, which has methods to execute the returned javascript automatically, and another is jquery, which, iirc, has about the same possibilities.
-- Abel --