2011-05-17 108 views
2

你好,我一直在試圖做大約2年。我認爲它曾經有過一次,但從那時起,我無法再讓它發生。林將此代碼添加到一個與塊將Bookmarklet Javascript添加到Block?

 
    <a href="javascript:u=document.location.href;t=document.title; s=window.getSelection(); 
void(window.open("http://onlinebanter.com/node/add/web2ob?edit[title]="+escape(t)+'&edit[body_field][body]='+escape(s)+'&edit[field_link][0][url]='+escape(u),'_blank','width=600,height=500,status=yes,resizable=yes,scrollbars=yes'));">Test</a> 

當我嘗試拖動到我的瀏覽器的URL出來的所謂

 
    javascript:u=document.location.href;t=document.title;s=window.getSelection();void(window.open(

我使用的全功能HTML過濾選項和心不是添加行休息或任何事情。如果我編輯我的瀏覽器的鏈接,並添加只是

javascript:u=document.location.href;t=document.title;s=window.getSelection();void(window.open("http://onlinebanter.com/node/add/web2ob?edit[title]="+escape(t)+'&edit[body_field][body]='+escape(s)+'&edit[field_link][0][url]='+escape(u),'_blank','width=600,height=500,status=yes,resizable=yes,scrollbars=yes')); 

事情工作的偉大。我已經看過,並在此前問過這裏 http://drupal.org/node/235074

我必須只是錯過了這麼簡單,因爲它似乎整個互聯網沒有這個問題。所有幫助表示感謝。

Reg`

回答

0

我認爲這個問題是在你的window.open()調用的雙引號。

瀏覽器認爲您要關閉href="javascript... "

"http://onlinebanter.com/node/add/web2ob?edit[title]="用單引號代替雙引號。

+0

Sryy John我完全錯過了這一點。即時旅行。我感謝你的迴應。讓我去試試吧......這是一個很好的約翰,這是固定的。這是一個很長的時間問題。非常感謝你 – 2011-07-22 19:07:02