开发者

How to add a uneditable url in a popup window using javascript

开发者 https://www.devze.com 2023-01-04 19:03 出处:网络
I am using javascript for opening a new window when clicked on the link. I want that the new window should dispaly开发者_StackOverflow中文版 the address bar but the value of that bar should not change

I am using javascript for opening a new window when clicked on the link. I want that the new window should dispaly开发者_StackOverflow中文版 the address bar but the value of that bar should not change.

Can i do that?

the script code i am usng is:

="Javascript:void(window.open('help.aspx?ID=" + Fields!ID.Value +"','mywindow','_self','width=500,height=500'))"

thanks in advance


I think that should be what happens using your code already.

Just remove the __self argument, it doesn't belong there and overrides your width and height settings.

window.open('help.aspx?ID=" + Fields!ID.Value +"','mywindow','width=500,height=500'))"


Just use the below Code:

function OpenNonEditableWindow(){
  window.open(
    'YourURL',
    'AnyNameForNewWindow', 
    'directories=no,titlebar=no,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=400,height=350'
  );
}

And Call It Like This :

<button type='button' onclick='OpenNonEditableWindow()'>Click Me</button>
0

精彩评论

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