开发者

iFrame Navigation controlled by JS

开发者 https://www.devze.com 2022-12-16 11:39 出处:网络
I\'m using javascript to control the href= field of the iframe located within the page. I am currently using

I'm using javascript to control the href= field of the iframe located within the page. I am currently using

function DoIFrameNav(object_URL)    
{       
    document.all.additionalText.src="iframeContents.php?id="+object_URL;    
    selectedEvent = object_URL;   

}//end DoIFrameNav

to perform this action. And

onclick=\"DoIFrameNav(".$iCounter.");

to call the action when the user clicks on the table row.

It works perfectly in Firefox and IE6, but nothing else... Chrome just ignores it...

What would be the universally browser compatible way o开发者_如何学Cf doing this?


You should not use document.all in a script that is intended to be cross-browser. Removing that should be your first step. Use document.getElementById() instead. At that point, the code you posted should be acceptable to all major browsers (hopefully).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号