Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What Doesn't FF Like About This Line??

Status
Not open for further replies.

PulsarSL

Programmer
Jul 4, 2005
24
NO
Hello everyone,

The following line is in an external .js file in the same directory as my html file. It is called when a button is pushed. txtPadNum is a textbox in the html file. In IE, it works perfectly. In Firefox, it does not update the div's innerHTML AT ALL. What doesn't firefox like?

Thanks

Pulsar

---
Code:
document.getElementById('uploadContainer').innerHTML = "<a href=index.php?action=u&etx=" + escape(inputEncryptedText) + "&pad=" + escape(document.getElementById('txtPadNum').value) + ">Upload Message</a>";-

(it is all on one line in my code)
 
What is the dash at the end of the line for?

If this isn't in the original, please post only what you copy and paste and don't type in your code.

Lee
 
Sorry. That was not part of the code. Not sure how it slipped in there as I did C&P -- Must have hit it somehow.

Pulsar
 

mbrooks

What is the purpose of the link? All that comes up is the word 'Resume' centered on the page.œ


mmerlinn

"Political correctness is the BADGE of a COWARD!"

 
Yeah.. been lagging a bit on my resumé.
I do that so when it gets spidered by Google there is atleast some info related to my website available.

M. Brooks
 

trollacious

The dash could be a random character inserted by the program that processes input to tek-tips. Take a look at my last post above. There is a random character at the end that I did not type in.

A lot of my posts have those random characters scattered throughout my posts. Doesn't matter if I use NS or IE, so I presume that the problem lies on the receiving end and not the sending end. Most of the random characters are unprintable, so you won't see them. However if you c&p some code with them in, that code will crash, and you will most likely go nuts trying to find the syntax error. Experienced that many times in the past, so now just look for invisible characters when everything else looks correct.


mmerlinn

"Political correctness is the BADGE of a COWARD!"

 
I copied and pasted the JS code in your original example, wrote a test page to match what the function was trying to do, and it worked fine in Firefox for me. What does the Javascript console say when you test it in Firefox? I got no errors, and the was changed and acted exactly like it should have.

Lee
 
Error: document.getElementById("txtPadNum") has no properties
 
Hmmm. Fixed it. The error from FF led me to investigate the code of the box. It was missing id="txtNumPad", but it's name was also set to "txtNumPad". Apparently IE falls back to the element's name if no id is specified, but FF does not?

Pulsar
 
That would make things "interesting" in IE if someone mixed IDs and names. IE is known for not following the standards.

Lee
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top