PDA

View Full Version : iframe - how to suppress javascript alerts in src page



jon.london
25 Nov 2010, 01:22 PM
hi

i am including an iframe in my page, as follows...


<iframe src="http://www.cult.co.uk/men/shop/hoods-and-sweats/details/26947/tin-tab-electronic-hood" />

problem is that the included src page, brings up javascript alert errors, into my website! is there any way i can supress these messages?

i know i can supress js alerts locally by using the following:


function alert(){}

But i am not sure how to do this for an iframe.

thanks

steved
02 May 2011, 11:17 PM
I had a similar problem, and came up with the following code, which will usually work with IE (this suits my needs). I do not know about other broswers, and it can be disabled cleint side in IE. It also seems to ignore cookies, which was something else that I wanted.

http://msdn.microsoft.com/en-us/library/ms534622(v=vs.85).aspx


<iframe src="child.htm" id="bframe" style="height:300px;width:300px;border:3px solid blue;" security="restricted"></iframe>