Hi all,
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.
So, please tell me how to match line breaks by using regular expression.
Regards,
Velhari
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.
Code:
function executeJSCodes( html ){
var regExp = new RegExp('<script language="javascript">(.*)<\/script>',"gi");
while( res = regExp.exec(html) ){
eval(res[1]);
}
}
Regards,
Velhari
Comment