The following code works as expected in IE8 and Safari4, but not in Firefox3.6 and Chrome. All browsers are on Windows.
& lt ;! DOCTYPE HTML PUBLIC "- // W3C // DTD HTML 4.01 Transitional // N" "http://www.w3.org/TR/HTML4/tool.dtd" & gt; & Lt; Html & gt; & Lt; Top & gt; & Lt; Meta http-equiv = "content-type" content = "text / html; charset = UTF-8" & gt; & Lt; Link href = "http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/smoothness/jquery-ui.css" rel = "stylesheet" type = "text / css" /> & Lt; Script type = "text / javascript" src = "http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" src = "http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" & gt; $ (Function () {$ ('# tab'). Tab ();}); & Lt; / Script & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Div id = "tab" & gt; & Lt; Ul & gt; & Lt; Li & gt; & Lt; A href = "http://www.google.com/" & gt; Google & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "http://www.msn.com/" & gt; MSN & lt; / A & gt; & Lt; / Li & gt; & Lt; / Ul & gt; & Lt; / Div & gt; & Lt; / Body & gt; & Lt; / Html & gt;
It seems that Firefox and Chrome cross-domain do not support AJAX by default, right? Is there an easy way to turn on cross-domain AJAX in Firefox and Chrome?
Use JSONP (Basically, you can use a & lt; script src = "otherdomain. Tld / .... .... callback = your_function "/>
(jQuery does automatically).
Comments
Post a Comment