I wrote the following Javascript function used to execute the Javascript codes from the ajax response which contains both html & javascript.
It works fine, if the javascript codes from the response doesn't have any line break at all.
Expand|Select|Wrap|Line Numbers
- function executeJSCodes( html ){
- var regExp = new RegExp('<script language="javascript">(.*)<\/script>',"gi");
- while( res = regExp.exec(html) ){
- eval(res[1]);
- }
- }
Regards,
Velhari