Welcome to DU! The truly grassroots left-of-center political community where regular people, not algorithms, drive the discussions and set the standards. Join the community: Create a free account Support DU (and get rid of ads!): Become a Star Member Latest Breaking News Editorials & Other Articles General Discussion The DU Lounge All Forums Issue Forums Culture Forums Alliance Forums Region Forums Support Forums Help & Search

wyldwolf

(43,891 posts)
Wed Feb 8, 2012, 06:24 PM Feb 2012

A vexing coding technique/trick I seem to have missed

In some e-mail newsletters I get there is a link withing the e-mail (not in the e-mail client but the newsletter) that states something like "Can't see the images below? Click here." When clicked, the images appear.

Anyone know how that is done?

Thanks!

6 replies = new reply since forum marked as read
Highlight: NoneDon't highlight anything 5 newestHighlight 5 most recent replies
A vexing coding technique/trick I seem to have missed (Original Post) wyldwolf Feb 2012 OP
That is usually your ISP blocking ChromeFoundry Feb 2012 #1
thanks for taking the time to explain it. wyldwolf Feb 2012 #2
no problem... ChromeFoundry Feb 2012 #3
yeh i've griped about the lack of < code > tags here more than once.. Phillip McCleod Apr 2013 #5
yet nebenaube May 2013 #6
Post removed Post removed Mar 2013 #4

ChromeFoundry

(3,270 posts)
1. That is usually your ISP blocking
Wed Feb 8, 2012, 09:57 PM
Feb 2012

potential spam and tracking images. The link is usually a call to a piece of JavaScript code that will replace the "src" attribute value on the "img" tags with the original URL. When the page loads, it usually filters the "src" attributes to load a semi-transparent gif image, hosted by your ISP.

An example of this would be if I had an image in my signature line that would load form my server. I would then be able to track every IP address that read my posts.

Since scripting is blocked on the DU servers, I cannot add additional specific information, such as your ID to the request...
Example:
[blockquote class="red"]< img src=" http :// someplace.com/someimage.gif?ID=wyldwolf " />

But, If I sent you an email and the contents of the message contained...
Example:
[blockquote class="red"]< img src=" http: // someplace.com/someimage.gif?ID=wyldwolf723%40domain.com " />

...then I would know that the spam message I sent you - 1) made it to a valid email address. 2) You read the email message.
Now, your address is added to a database to be sold to hundreds of other people trying to sell you Viagra, porn, Russian brides...

so, to answer your question... if you had the following HTML img tag, you could swap the src of the image like this:


< script >
function changeImage()
{
document.getElementById('8675309').src=' http: // someplace.com/image.gif ';
}
< /script >

< button ="changeImage();"> Can't see the Image? Click here! < /button>
< img id="8675309" src=" http: // your-isp.com/blank.gif " width="30" height="20"/>


Hope that makes sense...

ChromeFoundry

(3,270 posts)
3. no problem...
Thu Feb 9, 2012, 10:22 AM
Feb 2012

If you get stuck... you know where to find help.

Just so you are aware: It's kind of difficult to format HTML and Scripts in this new DU; a lot of extra spaces are needed so the Post sanitizer ignores the tags... so be patient in waiting for a response from the others.
If DU supported the < code > and < pre > tags, life would be much easier.

 

Phillip McCleod

(1,837 posts)
5. yeh i've griped about the lack of < code > tags here more than once..
Fri Apr 5, 2013, 06:41 AM
Apr 2013

it's especially annoying when trying to share python code since.. uh.. white space is god.

i imagine the 'computers & internet' forum would be more appealing to the very many, very liberal coders out here with that one tiny addition.

plus, i don't doubt there's an unchecked check box for it in the 'permitted tags' field of the admin section of this site. just try including <code> in the reply title and you'll see what i mean. no problem there. it's just in the body of the post, where i might actually want to *use* it that it's prohibited.

yeh that makes sense.

Response to wyldwolf (Original post)

Latest Discussions»Retired Forums»Website, DB, & Software Developers»A vexing coding technique...