Avatar billede fredand Forsker
03. august 2005 - 13:57 Der er 9 kommentarer og
1 løsning

img tag mysterious disappeared?

Hello!

A friend of mine got a strange problem, I bet any one around here may have a solution.

My friends description:

I have a website on a web hotel that supports ASP and consequently I have some of the pages coded with ASP.

A strange problem seems to appear for a few users that visit the website, although for most users it seems to work just fine, including myself, which makes it difficult for me to troubleshoot.

The problem is that the asp pages that contain image links won’t display the images in the end users browsers. I had one person send me her view source-code and I could see that the <img>tags simply had disappeared from the code, that is, the code looked like this:

<a href="somelink"></a>

instead of:

<a href="somelink"><img src="someimage" border="0"></a>

This only happens when the <img>tag is surrounded by a <a href>tag and it only happens on the asp pages, not the html pages.

What could be the reason for this to occur?

Does it have something to do with the server on the web hotel?

But why does it only occur for some users and not all?

It doesn’t seem that it has anything to do with the users browsers. One has the same browser as me, IE6 on a PC with a fast Internet connection.

Could it have something to do with the users Internet supplier?

But then wouldn’t they always have this problem with all web sites built with ASP?

That doesn’t seem to be the case. Anyone familiar with this problem?


Best regards from my friend and me!
Fredrik
Avatar billede hiks Nybegynder
03. august 2005 - 14:38 #1
hey

have you got a tag like this in top of the asp document?

<?xml version="1.0" encoding="UTF-8"?>

if you have try deleting it. Else try closing the image tag:

<a href="somelink"><img src="someimage" border="0" /></a>

or try validating your page:

http://validator.w3.org/

/hiks
Avatar billede softspot Forsker
03. august 2005 - 14:52 #2
I'm more likely to think that it is a bug in the ASP-code.

If you have the opportunity, please post some servercode here then we can take a look at it and maybe find the source of the problem.
Avatar billede fredand Forsker
04. august 2005 - 09:12 #3
Hello!

Thanks for your replies!

Here is a comment from my friend:

But that specific html code is not dynamically generated! It’s straightforward html. Although it is included in a Sub depending on which layout I want to be rendered. That works fine. The correct layout is displayed depending om which parameter I post to the page. The "only" bug is that the <img>tag disappears for a few users...


<%
Option explicit
Response.Buffer = True
Dim displayNo
displayNo = Request("no")

'Render layout
Select Case displayNo
    Case 1:
        Call Layout1()
    Case 2:
        Call Layout2()
    ...etc...
End Select                                     
%>

<%
Sub Layout1()
%>
html code... <a href="link1.html"><img src="image1.jpg"></a> ...more html code...
<%
End Sub
%>

<%
Sub Layout2()
%>
html code... <a href="link2.html"><img src="image2.jpg"></a>...more html code...
<%
End Sub
%>

Best regards
Fredrik and friend
Avatar billede fredand Forsker
04. august 2005 - 09:16 #4
Btw
Comment only from me!
I am not familiar with asp but shouldn't a Case stop with a "break" so it will not continue with the next Case.?
I use to do so in Java with switch, if I do not want it to continue with the next case I "break". I will ask my friend about how she would like it to run.

How ever if the code is not just a description a <img> should be in the output any way.


Best regards
Fredrik
Avatar billede fredand Forsker
04. august 2005 - 09:38 #5
I have just confirmed that a select in asp does not need a break to just execute one of the caeses so that is not the problemo then.
/Fredrik
Avatar billede hiks Nybegynder
04. august 2005 - 09:40 #6
but still - have you tried removing it and reloading the page - Internet Explorer has a bug concerning that.

/hiks
Avatar billede softspot Forsker
04. august 2005 - 09:41 #7
Is there any particular value of Request("no") that fails?
Avatar billede erikjacobsen Ekspert
04. august 2005 - 09:55 #8
Image tags don't just disappear ;)

1) Do you have a link to the site?
2) Did you have a previous version without the images? If so your users could see a cached copy.
3) Some firewall/virus-thing/local-proxy on the users machine could manipulate the HTML code and remove things. I've never seen anyone remove images from the original site, but if you are referring to images on some other site, it might be relevant (I do this in my browser to avoid some advertisements)
Avatar billede fredand Forsker
04. august 2005 - 14:33 #9
Hello!

Here is the link to the site, a site about cats:
www.silverkatten.net -> Uppfödning -> Uppfödare

According to my friend the user that experienced this has empty the cache.

The problem occurs under "Uppfödare".
For eg under "Brittiskt korthår" there should be 4 img-links.
Works for me but not for some users.

/Fredrik
Avatar billede fredand Forsker
30. december 2006 - 13:25 #10
Lets close this one
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester