开发者

Jquery show() not working in FF

I have issues with FF & Jquery .show().

my website shows an emb开发者_StackOverflowedded map from google in clicking a link.i have got a javascript function that handle this, in safari it works great.FF won't show the map.

this is the js. function:

  function mostraPagina(nome){



  if (nome='mappa'){
   $('#mappa').load('contenuti/mappe/mappa_thiene.html');
   $('#dark_background').show(600);
   $('#mappa').show(600);
  }

 }

the embedded code from google maps is:

<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=Via+Murialdo,+4,+Thiene+italy&amp;sll=45.710686,11.475665&amp;sspn=0.002439,0.005676&amp;ie=UTF8&amp;hq=&amp;hnear=Via+Murialdo,+4,+36016+Thiene+Vicenza,+Veneto,+Italy&amp;ll=45.710222,11.475618&amp;spn=0.001219,0.002838&amp;t=h&amp;z=14&amp;output=embed"></iframe>

thank you very much.


One possible problem:

if (nome='mappa'){

You're assigning the value of nome to 'mappa' which evaluates to true always (because of the way non-empty strings typecast to true). Your code should probably be

if (nome=='mappa'){


are you sure this

if (nome='mappa'){

is what you want? that would just be like if(true)

should be:

if (nome == 'mappa'){

which does the comparison you are looking for I guess

but ACTUALLY it should be:

if (nome === 'mappa'){

which not only comparse the value, but also the type. Well why not do a regexp test?

if (/^mappa$/.test(nome)){

:)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜