Mark Henry
Mark Henry

Reputation: 2699

Jquery load function not displaying content in Opera and IE

I use a jquery load function to display weather information below a webcam. It works in firefox browsers but not in opera and IE

$("#forecast").load("/v3/ajax/liveforecast.php?res_id=1804&sw=48 #weatherme");

For testing (section highlighted with red border): http://sionvalais.com/review/ehrwald/129842

It is not a css issue 'cos the div is showing at the right location.

Anyone now of any bugs in Opera>

This is what i load:

<div id="weatherme"><div style="display:inline-block;float:left;width:40px;margin:0 2px;text-align:center;font-size:10px;color:#fff;"><span style="display:block;width:38px;height:44px;padding-top:16px;"><img src="http://sionvalais.com/gfx/flake.png" />110cm<br />60cm</span></div><div style="display:inline-block;float:left;width:40px;margin:0 2px;text-align:center;font-size:10px;"><span title="Fog" style="display:block;width:38px;height:44px;background:transparent url(http://sionvalais.com/wetter/images/39x39/20.png) no-repeat;"><em style="color:#fff;display:inline-block;margin-top:34px;">3mm</em></span><span style="display:block;color:#fff;">Sun </span><span class="warm">3</span>/<span class="warm">5</span> </div><div style="display:inline-block;float:left;width:40px;margin:0 2px;text-align:center;font-size:10px;"><span title="heavy snow" style="display:block;width:38px;height:44px;background:transparent url(http://sionvalais.com/wetter/images/39x39/16.png) no-repeat;"><em style="color:#fff;display:inline-block;margin-top:34px;"></em></span><span style="display:block;color:#fff;">Mon </span><span class="cold">0</span>/<span class="warm">4</span> </div><div style="display:inline-block;float:left;width:40px;margin:0 2px;text-align:center;font-size:10px;"><span title="Cloudy" style="display:block;width:38px;height:44px;background:transparent url(http://sionvalais.com/wetter/images/39x39/30.png) no-repeat;"><em style="color:#fff;display:inline-block;margin-top:34px;"></em></span><span style="display:block;color:#fff;">Tue </span><span class="cold">-2</span>/<span class="warm">1</span> </div><div style="display:inline-block;float:left;width:40px;margin:0 2px;text-align:center;font-size:10px;"><span title="Snow" style="display:block;width:38px;height:44px;background:transparent url(http://sionvalais.com/wetter/images/39x39/14.png) no-repeat;"><em style="color:#fff;display:inline-block;margin-top:34px;">2mm</em></span><span style="display:block;color:#fff;">Wed </span><span class="warm">3</span>/<span class="cold">-2</span> </div><div style="display:inline-block;float:left;width:40px;margin:0 2px;text-align:center;font-size:10px;"><span title="Snow" style="display:block;width:38px;height:44px;background:transparent url(http://sionvalais.com/wetter/images/39x39/14.png) no-repeat;"><em style="color:#fff;display:inline-block;margin-top:34px;">9cm</em></span><span style="display:block;color:#fff;">Thu </span><span class="cold">-3</span>/<span class="cold">-1</span> </div></div>

Upvotes: 2

Views: 939

Answers (2)

Shadow Wizard
Shadow Wizard

Reputation: 66388

You are loading whole document (including the <html><head>..... stuff) which is not good practice.

Load just the specific part you need e.g.

$("#forecast").load("/v3/ajax/liveforecast.php?res_id=1804&sw=48 #Contents");

Where Contents is the ID of the element containing the actual data you need.

Edit: after seeing your edit and viewing the source, maybe it's due to the combination of float and inline-block display - see this question:
Layout problem (floats) specific to Opera

Upvotes: 0

Emil Stenstr&#246;m
Emil Stenstr&#246;m

Reputation: 14086

Opera is reporting this script error:

Inline script compilation
Syntax error at line 18 while loading:
     $(this).("previous views");
    ---------^
expected identifier, got '('

Upvotes: 1

Related Questions