开发者

iFrame Navigation controlled by JS

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜