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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hyperlink working in IE but not in Firefox

Status
Not open for further replies.

alexisb

Programmer
Apr 5, 2001
100
US
I wrote pages in ASP/VBScript (no JS). It was working fine in IE but some of the pages had issues in Firefox. I've resolved most of the issues but can't seem to get this one.

I've pasted my code below. The doc list displays but there's no hyperlink in Firefox. I reviewed posts in this and other forums and put the full path below, but that still didn't resolve the problem in Firefox. It still works fine in IE.

response.write "<table border=1 align='center'><tr><td>Document Name</td></tr>"
while not objRec.eof
response.write "<tr><td><a href=' & objRec("docname") & "'</a>" & objRec("docname") & "</td></tr>"
objrec.movenext
wend
response.write "</table>"

Thanks!
Alexis
 
Another major thing I noticed is that my VBScript is not working in Firefox. I am new to ASP - I guess I should have known that it wouldn't work. I didn't realize users would be using Firefox (but I should have considered it). I will have to rewrite the VBScript logic in JavaScript, right?
Thanks,
Alexis
 
the VBSCRIPT you have above is all server-side code - FireFox or IE dont even see it as it is all run on the server. IE and Firefox both see the exact same HTML code.

The reason Firefox doesnt work and IE does is because your HTML code is incorrect. IE is more forgiving and has guessed what you meant. Firefox is much more strict (rightly so in my opinion) and as such has shown the error.

You have a missing [red]>[/red] after your <a href=''

Tony

Spirax-Sarco - steam traps control valves heat exchangers
Sun Villa - Luxury Florida accommodation
 
Tony,
Thanks. I looked and looked trying to find a missing < or > or other problem but never noticed it. You are absolutely right about my mistake. That fix resolved the problem.

I think I understand what you are saying server-side scripting and why the VBScript code I pasted in my previous post works. However, I have other VBScript code that I think is client side and that I will have to rewrite. I'll paste it below and would again appreciate your insight.

<script language=vbscript>
Sub btnSubmit_OnClick()
'Prompt the user to ensure they want to delete the user
lngRC = MsgBox("Deleting a user is irreversible." & vbCRLF & _
"Are you sure you want to delete " & _
frmDisplay.cboUsers(frmDisplay.cboUsers.selectedIndex).text & _
"?",vbOKCANCEL,"Delete User Form")

'If the user chose OK then proceed
If lngRC = vbOK Then
Call frmDisplay.submit()
End If
End Sub
</script>

Thanks again.
Alexis

 
Tony,
We just posted at the same time. Yes, when I went to fix the a tags, I saw that I had to move the </a> too and did so.
Thanks so much!
Alexis
 
Yep VBScript is IE only. AVOID.

You have to be careful with JavaScript to, as there are lots of Microsoft only functions/properties.

Jon

"I don't regret this, but I both rue and lament it.
 
Thanks for your help. I really appreciate it. I was able to fix all the server side issues so the code works in Firefox and IE. Now I'll rewrite the client side code in JavaScript.
Alexis
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top