By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,814 Members | 2,162 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,814 IT Pros & Developers. It's quick & easy.

Javascript not working in Firefox

P: n/a
Hi there...

I have a little problem using some javascript in my web app. The app
seems to work fine in IE but when i use firefox to view it..the
javascript doesn't seem to work....

I am using turbogears to make my app..but the layout is mostely html
and css
Heres the page thats giving me the troulbe

<table border="0">
<dl xmlns:py="http://purl.org/kid/ns#" class="${field_class}"
id="${field_id}"
py:attrs="list_attrs">
<?python x=1 ?>
<DT py:for="i in xrange(0, len(options))">
<?python value, desc, attrs = options[i] ?>
<?python blurb = blurbs[i] ?>
<tr border="1">

<td align="left" valign="top">
<input type="radio" name="${name}"
id="${field_id}_${value}" value="${value}"

py:attrs="attrs" />
</td>

<td align="left">

<div id="${x}" class="mborder" style="width:300px;
height:20px;
background:#FFFFFF;overflow:hidden;">
<STRONG>
<label for="${field_id}_${value}" py:content="desc"
/>
</STRONG>
<DD>${blurb}</DD>
</div>
</td>

<td align="left" valign="top">
<img src="/static/images/arrowd.gif" alt="arrow
down" title="click to view"
onclick="showm('${x}','${x}')" id="${x}"/>
</td>

</tr>
<?python x=x+1 ?>
</DT>
</dl>
</table>

The line thats giving me the trouble is the:
<img src="/static/images/arrowd.gif" alt="arrow down" title="click to
view"
onclick="showm('${x}','${x}')" id="${x}"/>

that onclick is sending that function to javascript in the head..here
it is
<script type="text/javascript">

var doit = true
function showm(ob,pict) {
if(doit) {
document.getElementById(ob).style.height = '120'

doit = false
}
else {
document.getElementById(ob).style.height = '20'

doit = true
}
}

</script>

I am not totally sure if this is a problem with the javascript or the
use of css and changing the div size...

Any suggestions would help

Sep 4 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a

OriginalBrownster wrote:
<div id="${x}" class="mborder" style="width:300px;
height:20px;
[snip]
The line thats giving me the trouble is the:
<img src="/static/images/arrowd.gif" alt="arrow down" title="click to
view"
onclick="showm('${x}','${x}')" id="${x}"/>
[snip]
function showm(ob,pict) {
document.getElementById(ob).style.height = '120'
Your function is being sent the string "${x}", and is thus the id to be
gotten. However, I don't believe your id is valid.
>From the W3C:
url: http://www.w3.org/TR/html4/types.html#type-name

ID and NAME tokens must begin with a letter ([A-Za-z]) and may be
followed by any number of letters, digits ([0-9]), hyphens ("-"),
underscores ("_"), colons (":"), and periods (".").

Sep 4 '06 #2

P: n/a


Even after changing it to an alpha ID it still does not work in firefox

Thank you for your suggestion

Sep 4 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.