2015-05-11 66 views
-3

我在按鈕上有一個onclick,但它不能正常工作。錯誤onclick按鈕代碼錯誤?

<a href="javascript:void(0)" class="button" onclick=\'websiteopen("'.$site->page_id.'","fb"), PopupCenter("http://nullrefer.com/?'.$site->facebook.'","Website", "'.$site->id.'", "'.$site->title.'", 1000,500,"fb");jqxAlert.alert("Verifying..<img src=\'http://website.com/_template/images/load.gif'>");$(this).fadeOut().delay(4100).fadeIn();\'><b class="glyphicons thumbs_up" style="height:8px;vertical-align:baseline;padding:2px 9px"><i></i></b> '.$lang['sp17'].'</a> 

這是錯誤的東西在這部分代碼:

jqxAlert.alert("Verifying..<img src=\'http://website.com/_template/images/load.gif'>"); 

問題是什麼?

+0

你需要學習基本的JavaScript字符串語法... –

+0

什麼是這個HREF的文字部分 – harrrrrrry

+0

你需要把? onclick裏面的值(很可能是單引號),你需要關閉''),你需要''標籤中的一些文本。 –

回答

1
+0

考慮到這是一個js警報框(不是window.alert函數)(它看起來像jquery警報)。如果是這樣,它可能會接受圖像標籤(和其他html)作爲文本的一部分。 –

+0

同意,但我做了一個快速搜索插件(發現這個:http://www.jqwidgets.com/jquery-alert-popup/),這似乎是一個風格相當於js window.alert();我會添加引用來使這個清除 –

+0

它不起作用 – XDesign

0

請謹慎使用雙引號。在html中,你可以在雙引號內寫簡單的引號,它翻譯得很好。

「);」

或者使用功能:

Functions on clic