Hello,
I am having a problem with setting a div with innerHTML,
using AJAX and your basic php backend.
The problem is when I make a AJAX request the image is
not displayed. After setting the innerHTML.
Examples can be seen at:
http://usatoday.snocountry.com/displayi ... ode=303007
http://usatoday.snocountry.com/displayi ... snowreport
If you click 'snow report' or 'resort info' at the top you will see the transition
but the images do not show up.
Has anyone encountered this? I am imagine it is a simple fix, with the problem
induced by late night coding...
Thanks in Advance
Michael
http://www.snocountry.org
AJAX innerHTML and image not displaying
Moderator: General Moderators
-
snowDeveloper
- Forum Newbie
- Posts: 2
- Joined: Thu Nov 17, 2005 12:33 am
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
In your links, their appears to be unparsed php vars ($permcode):
These are the two links that you are having problems with, correct? Maybe look at the script that is outputing this to see why these vars are echoing out as vars rather than the var value.
Code: Select all
<div id="primarySnoNav">
<b><a class="snoLink" href="#" onclick="javascript:processLinkUI('resortinfo|{$permcode}'); return false;"><font face="Arial" size="2" color="#0099FF"> resort</font> <font face="Arial" size="2" color="#666666"> info</font> </a> </b>
│
<b><a class="snoLink" href="#" onclick="javascript:processLinkUI('snowreport|{$permcode}'); return false;"> <font face="Arial" size="2" color="#0099FF">snow</font> <font face="Arial" size="2" color="#666666"> conditions </font></a> </b>
│- n00b Saibot
- DevNet Resident
- Posts: 1452
- Joined: Fri Dec 24, 2004 2:59 am
- Location: Lucknow, UP, India
- Contact:
-
snowDeveloper
- Forum Newbie
- Posts: 2
- Joined: Thu Nov 17, 2005 12:33 am
Problem fixed...
Thanks,
Your posts were correct and lead me down
the path to a couple other such errors.
I know coding after 11:00pm is not a good
idea....
Michael
http://www.snocountry.org
Your posts were correct and lead me down
the path to a couple other such errors.
I know coding after 11:00pm is not a good
idea....
Michael
http://www.snocountry.org
innerHTML will overwrite everything that already included in that block
could that be your problem?
Code: Select all
<div id="ha"><img src="what.jpg"></div>
ha.innerHTML = "some text";
<div id="ha">some text</div>