views:

54

answers:

3

The following code works as expected in IE8 and Safari4, but not work in Firefox3.6 and Chrome. All browsers are on Windows.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/smoothness/jquery-ui.css" rel="stylesheet" type="text/css" />
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"&gt;&lt;/script&gt;
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js"&gt;&lt;/script&gt;
        <script type="text/javascript">
            $(function() { $('#tabs').tabs(); });
        </script>
    </head>
    <body>
        <div id="tabs">
            <ul>
                <li><a href="http://www.google.com/"&gt;Google&lt;/a&gt;&lt;/li&gt;
                <li><a href="http://www.msn.com/"&gt;MSN&lt;/a&gt;&lt;/li&gt;
            </ul>
        </div>
    </body>
</html>

Seems that Firefox and Chrome do not support cross-domian ajax by default, right? Is there any easy way to turn on cross-domian ajax in Firefox and Chrome?

A: 

XSS (cross site scripting) is a big bad. Unless you're talking about making security modification to the other to make them support it, I can't believe they would by default.

Edit

I just noticed that the code you have there isn't doing any XSS though. What kind of errors (if any) are you getting from this?

Lance May
No error shows in the console. But in Firefox and Chrome, nothing shows below the tabs.
Ethan
What you're wanting to do should not be default in **any** browser, as it as it is, in fact, CSS and therefore a HUGE security risk to be enabled on a browser.
Lance May
A: 

can this help http://www.ajax-cross-domain.com/ ?

Bala R
I'll look at this. But seems that it is not an easy way.
Ethan
A: 

Use JSONP (basically, you insert a <script src="otherdomain.tld/....?callback=your_function"/> (jQuery does it automagically).

Nicolas Viennot