Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Javascript not working in Firefox

Reply
Thread Tools

Javascript not working in Firefox

 
 
OriginalBrownster
Guest
Posts: n/a
 
      09-04-2006
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 xmlnsy="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

 
Reply With Quote
 
 
 
 
web.dev
Guest
Posts: n/a
 
      09-04-2006

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 (".").

 
Reply With Quote
 
 
 
 
OriginalBrownster
Guest
Posts: n/a
 
      09-04-2006


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

Thank you for your suggestion

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Javascript not working in firefox utahfriend Firefox 0 02-11-2009 01:13 PM
Help: Javascript not working in Firefox "event not defined" Wiseman Javascript 1 07-25-2008 03:04 PM
Javascript tabindex forcing working fine in Firefox but not IE, HELP please! ScottRoot2@gmail.com HTML 2 01-10-2007 04:14 AM
JavaScript not working in IE and Safari, works in Firefox fine. dpodkuik@gmail.com Javascript 4 02-18-2006 12:51 AM
Javascript not working with Safari/Firefox (Mac) JB Javascript 3 11-07-2004 11:17 AM



Advertisments