bookmarklet在ie8中不起作用(但在firefox 24和chrome 30中有效)

时间:2013-10-08 15:33:02

标签: javascript internet-explorer-8 bookmarklet

以下bookmarklet在firefox中运行正常,但是当我在ie8中单击它时会弹出一个窗口但没有显示任何内容(submit.php页面应该在弹出窗口中显示正确的值来自网页标题,链接,等填写)...

的javascript:

url = "http://localhost:8080/submit.php";
Q = document.selection ? document.selection.createRange().text : document.getSelection();
L = location.href;
T = document.title;
pop = window.open("", "addEntry", "scrollbars=no,resizable=yes,
toolbars=yes,width=600,height=650,status=yes");
pop.document.body.appendChild(document.createElement('div')).innerHTML =
    '<form%20name="submitThis"%20method="POST"%20action=' + url + '>
<textarea%20name="title">' + T + '</textarea> <textarea%20name="link">' + L + '</textarea>
<textarea%20name="comnt">' + Q + '</textarea>
<input%20type="hidden"%20name="pActs"%20value="new"></form>';
pop.document.forms['submitThis'].submit();

......有什么想法吗?

编辑:

如果我修改书签并删除弹出窗口部分,它将在ie8 ...

中正常工作
javascript:uri="http://localhost:8080/submit.php";Q=document.selection?document.selection.createRange().text:document.getSelection();L=location.href;T=document.title;document.body.appendChild(document.createElement('div')).innerHTML='<form%20name="submitThis"%20method="POST"%20action='+uri+'><textarea%20name="title">'+T+'</textarea><textarea%20name="link">'+L+'</textarea><textarea%20name="comnt">'+Q+'</textarea><input%20type="hidden"%20name="pActs"%20value="new"></form>';document.forms['submitThis'].submit();

...所以如何在ie8 ???

中获得弹出的书签

0 个答案:

没有答案