【问题标题】:What is the Exact Function to Popup a Window?弹出窗口的确切功能是什么?
【发布时间】:2013-07-11 06:08:54
【问题描述】:

这是弹出框的代码:

<?php
$getBtsid = $_REQUEST['uid'];
$btsid = substr($getBtsid, 0, -1);
?>

<center>

<?php
conFunc($db); // Connection Function

$congestedsite = mysql_query("SELECT * FROM `rollout_tracker` WHERE `site_id` LIKE '%".$btsid."'");
while($rows = mysql_fetch_array($congestedsite))
{
    echo "<b>BTS ID:</b> " . $btsid . "<br />";
    echo "<b>Sector ID:</b> " . substr($getBtsid, -1) . "<br />";
}
echo "<br /><br /><br />";
echo '<a href="javascript:window.close();">CLOSE WINDOW</a>';  
?>

这就是弹出框的名称:

echo "<a href=javascript:popcontact('btsdetails.php?uid=" . $row["bs_id"] . "')>" . $row['bs_id'] . "</a>"; 

我的 JavaScript 函数在下面:

function popcontact(URL)
{
    var popup_width = 600;
    var popup_height = 400;
    var day = new Date();
    var id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width='+popup_width+',height='+popup_height+'');");
}

虽然这段代码可以工作,但它在某种程度上影响了我的其他 JavaScript 代码。

我不明白原因。可能,我在这段代码中遗漏了一些东西。

谁能帮我解决这个问题?请问?

【问题讨论】:

  • 通过您自己的编写,代码正在运行。有什么问题?
  • 但是对于这段代码,其他 JavaScript 代码不起作用,所以我想可能是我对这个代码块做错了!这就是为什么与大家分享,看看我是否对这段代码做错了。
  • 那么,其他代码中的“不工作”是什么?你怎么知道出了什么问题,更重要的是你为什么认为是这个块造成的?

标签: javascript html popup window


【解决方案1】:

为我工作

function OpenCustomerInfo(OrderID) {
    CustomerInfoWin = window.open('customer_details.asp?orderid=' + OrderID, 
    'CustomerInfoWin',
    'width=600, 
     height=300, 
     left=200, 
     top=200, 
     resizable=yes,
     scrollbars=no,
     menubar=yes')

    CustomerInfoWin.focus();
 }

【讨论】:

    猜你喜欢
    • 2019-03-17
    • 2017-07-15
    • 2013-12-01
    • 2018-01-04
    • 1970-01-01
    • 2014-11-11
    • 1970-01-01
    • 2021-11-04
    • 2016-08-12
    相关资源
    最近更新 更多