Window.Open JavaScript 기능이 Mozilla에서 작동하지 않지만 다른 브라우저에서 작동합니다.

StackOverflow https://stackoverflow.com/questions/2468763

문제

wind

<a href="javascript:window.open('../Terms.aspx','Terms','width=550,height=400')">
                click here</a>

실제로 무슨 일이 있었는지 Mozilla 팝업이 열렸지만 부모 창이 비어 있습니다. [object Window]

내가 뭘 잘못하고 있는지 말 해주세요.

감사

도움이 되었습니까?

해결책

The script looks all right, what might be a problem is that you are running it in the URL. Use the click event instead.

Also, you can use the href and target attributes in the link to make it degrade gracefully. That way the link will at least open up the page even if Javascript is disabled in the browser:

<a href="../Terms.aspx" target="Terms" onclick="window.open(this.href,this.target,'width=550,height=400');return false;">
  click here</a>

다른 팁

Try a generator.

Alternatively, you might want to try href="javascript: randomVar = window.open ...". The issue might be that the window.open function returns an ID, thus breaking the in-line JavaScript.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top