0

This is some js in one of my views:

var $link = '<a href="javascript:window.open(\'../EForm/Info?formId=' + data.record.Form.Id + '\',&#34;EForm Details&#34;,&#34;height=550,width=345&#34;);">info</a>';

I want to pop open a new small window when someone clicks on the details of an item on my page. The code above renders this html on the page:

<a href="javascript:window.open('../EForm/Info?formId=1',"EForm Details","height=550,width=345");">info</a>

which is only working in chrome (no popup blockers are enabled in IE9 or FF ) what am i doing wrong here?

EDIT

ok ive updated the markup same issue only works in chrome,

<a href="javascript:window.open('../EForm/Info?formId=1','EForm Details','height=550,width=345');">info</a>

EDIT #2

Ok think ive got the markup kinda fixed FF and IE are now opening my popup but when they do the parnt window content is replaced with [object] in IE and [Window Object] in FF.... Now what the heck is going on?

 <a href="javascript:window.open('../EForm/Info?formId=1','EForm_Details','height=550,width=345');">info</a>
4

2 回答 2

0

好的,所以这篇文章指出了我的解决方案。 弹出错误对象窗口

这是我的新标记:

 var $link='<a href="javascript: var wind= window.open(\'../EForm/Info?formId='+data.record.Form.Id+'\',\'EForm_Details\',\'height=550,width=345\');">info</a>';

这是它的渲染方式:

<a href="javascript: var wind= window.open('../EForm/Info?formId=1','EForm_Details','height=550,width=345');">info</a>

它在所有 3 种浏览器中都能完美运行。

于 2012-10-20T19:00:37.627 回答
0

可能是因为您没有转义双引号。

修改的:

<a href="javascript:window.open('../EForm/Info?formId=1','EForm Details','height=550,width=345');">info</a>
于 2012-10-20T17:54:50.273 回答