javascript - 使用 Javascript 中的弹出窗口重定向到另一个 url

标签 javascript

问题是当我点击弹出窗口中的保留链接时

enter image description here

弹出窗口是重定向到另一个链接的窗口

enter image description here

如何将下面圈出的网址重定向到 Admin/reserve.php?

enter image description here

这是我的代码:

   <script type="text/javascript">
   function openWin()
   {

    myBtn=window.open('','','width=200,height=200');
    myBtn.document.write("<p>Lot Name: Esperanza</p>");
    myBtn.document.write("<p>Lot Price: P800,000</p>");
    myBtn.document.write("<p>Lot Size: 50 sq. metres</p>");
    myBtn.document.write('<a href="Admin/reserve.php">Reserve</a>');;
    myBtn.focus();



    }
    </script>

最佳答案

试试这个

window.name = "_oldWindow";
myBtn=window.open('','_NewWindow ','width=200,height=200');
myBtn.document.write("<p>Lot Name: Esperanza</p>");
myBtn.document.write("<p>Lot Price: P800,000</p>");
myBtn.document.write("<p>Lot Size: 50 sq. metres</p>");
myBtn.document.write('<a href="Admin/reserve.php" target="_oldWindow">Reserve</a>');;
myBtn.focus();

关于javascript - 使用 Javascript 中的弹出窗口重定向到另一个 url,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22317494/

相关文章:

javascript - 如何选择 parent 中选择元素的最近div直到

javascript - 使用 jQuery 获取页面并提取特定类的所有链接

javascript - 使用 ng-repeat 解析 AngularJS 中的错误

javascript - 使用 PhantomJS 桥序列化函数

javascript - Twitter Bootstrap 不支持 less.js

JavaScript/JQuery : Best way to avoid nesting of asynchronous functions/anonymous callback functions

javascript - 分数计数器不能正确计算分数

javascript - 计算器应用程序浮点运算的解决方案

javascript - 使用 Angular Formly 时,表单提交中不包含空字段

javascript - Ruby On Rails 应用程序与有关 AJAX 的 angularJS