douju4278 2008-11-28 14:07
浏览 100
已采纳

从html创建一个popupwindow,而不是一个文件

I have a php page that displays rows from a mysql db as a table. One of the fields contains HTML markup, and I would like to amke this row clickable and the html would open in a new popup window. What is the best way to do it, and is there a way to do it without writing the html to a file?

edit: this php page is actually part of an ajax app, so that is not a problem. I do not want to use jquery, as I would have to rewrite the application.

edit:

I have tried this again using the example below, and have failed. I know my script tag is wrong, but I am just echoing out row2 at the moment, so I think my logic is wrong before it ever gets to the javascript.

$sql="SELECT * FROM Auctions WHERE ARTICLE_NO ='$pk'";
$sql2="SELECT ARTICLE_DESC FROM Auctions WHERE ARTICLE_NO ='$pk'";
$htmlset = mysql_query($sql2);
$row2 = mysql_fetch_array($htmlset);
echo $row2;
/*echo '<script> child1 = window.open ("about:blank")
child1.document.write("$row2['ARTICLE_DESC']");
child1.document.close()*/
  • 写回答

4条回答 默认 最新

  • dongni1892 2008-11-28 14:19
    关注
    child1 = window.open ("about:blank")
    child1.document.write("Moo!");
    child1.document.close()
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 Oracle中如何从clob类型截取特定字符串后面的字符
  • ¥15 想通过pywinauto自动电机应用程序按钮,但是找不到应用程序按钮信息
  • ¥15 MATLAB中streamslice问题
  • ¥15 如何在炒股软件中,爬到我想看的日k线
  • ¥15 51单片机中C语言怎么做到下面类似的功能的函数(相关搜索:c语言)
  • ¥15 seatunnel 怎么配置Elasticsearch
  • ¥15 PSCAD安装问题 ERROR: Visual Studio 2013, 2015, 2017 or 2019 is not found in the system.
  • ¥15 (标签-MATLAB|关键词-多址)
  • ¥15 关于#MATLAB#的问题,如何解决?(相关搜索:信噪比,系统容量)
  • ¥500 52810做蓝牙接受端