Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > HTML > HTML Code Clinic
|
HTML Code Clinic Do you have some HTML code you'd like to share and get suggestions from others for tweaking or improving it? This discussion is the place.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the HTML Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 29th, 2004, 12:45 PM
Authorized User
 
Join Date: Jun 2003
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default Anchor Problem - Plz Help - ThnX !

Hi people !

Thanks for reading this post.

I've an anchor tag like this:

><A HREF="https://digitalid.verisign.com/as2/xxxx" TARGET="new"><IMG SRC="images/image01.gif" ></A>

Now, I need to change the link, but I've to somehow incorporate this script:

<script src=https://seal.verisign.com/getseal?host_name=www.mycompanyname.com&
size=S&use_flash=NO&use_transparent=YES></script>


Basically, ppl should be able to click on the image and go to the new url.

I've tried taking the new hyperlink and replacing the current one, but that
doesn't work.

Here's what I've tried:

<A HREF="https://seal.verisign.com/getseal?host_name=www.mycompanyname.com&
size=S&use_flash=NO&use_transparent=YES" TARGET="_blank"><IMG SRC="images/image01.gif" ></A>

or

<A HREF="https://seal.verisign.com/getseal?host_name=www.mycompanyname.com&size=S&use _flash=NO
&use_transparent=YES" onclick="window.open(this.href,'myWin');return false;"><IMG SRC="images/image01.gif" ></A>

But I'm getting the 'File Download' option opening up as soon as the
link is clicked. The 2 options are to open or save. I saved it,
but it's just 'getseal'. When I tried to open, Windows doesn't know how to open it.

Someone has suggested that "the best place to put a script tag
 is in the header of the html... after you have done that,
the script will be executed when the page is loaded"; but I'm clueless at this point.

I don't really care how I get this to work.

Can someone please show how I would incorporate the script onto the image?

Thanks in advance for your replies !
 
Old June 29th, 2004, 02:05 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

<script src=www.mycompanyname.com&" target="_blank">https://seal.verisign.com/getseal?ho...mpanyname.com&
size=S&use_flash=NO&use_transparent=YES></script>

This is absolutely incorrect markup. What are you trying to do?

Snib

<><
 
Old June 29th, 2004, 02:14 PM
Authorized User
 
Join Date: Jun 2003
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for your reply Snib.

Well, we had a verisign image for ppl to verify our certificate through their web site.

The original link was this:

<A HREF="https://digitalid.verisign.com/as2/xxxx" TARGET="new"><IMG SRC="images/image01.gif" ></A>

Our old cert expired, so our system engineer gave me the script stuff from verisign to work with for the new cert.

I want ppl to click on the image and take them to verisign to verify.

If it's absolutely incorrect markup, I'll need to verify with the person who gave it to me.

Is there anyway to change the markup to get the link to work?

Thanks for your post.
 
Old June 29th, 2004, 02:24 PM
Authorized User
 
Join Date: Jun 2003
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sorry Snib. Worry link.

It's like this:

<SCRIPT SRC=https://seal.verisign.com/getseal?host_name=www.mycompanyname.com&size=S&use _flash=NO&use_transparent=YES></SCRIPT>

Any ideas?
 
Old June 29th, 2004, 02:28 PM
Authorized User
 
Join Date: Jun 2003
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This post adds stuffs to my link; that's why it came out wrong in the first place.

It should be like this:

-- ' "
< S C R I P T SRC = h t t p s ://seal.verisign.com/getseal?host_name=www.mycompany.com&
size=S&use_flash=NO&use_transparent=YES>
< / S C R I P T >
"
 
Old June 29th, 2004, 03:32 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

So are you trying to link to the page with the seal, or are you trying to link to an external script?

The <script> tags are used to execute script (from a remote file, with the src attribute), and should be used like this:

<script src="http://domain.com/scripts/scripts.js" language="javascript" type="text/javascript"></script>

The <a> tag is for linking to things, they are called anchors or hyperlinks:

<a href="http://domain.com/pages/where_you_want_to_go.extension">Click</a>

The above markup will output something like this: Click

You cannot have spaces in tag names, attributes or attribute values. Therefore...

< S C R I P T SRC = h t t p s ://seal.verisign.com/getseal?host_name=www.mycompany.com&
size=S&use_flash=NO&use_transparent=YES>
< / S C R I P T >

...is invalid, change it to:

<script src="https://seal.verisign.com/getseal?host_name=www.mycompany.com&size=S&use_fla sh=NO&use_transparent=YES">
</script>

Notice also how I have quoted the attribute values. It is not always neccessary to do so but it's a good habit to have.

But the bottom line is, are you wanting to execute a script or hyperlink to a page?

I hope I haven't confused you,

Snib

<><
 
Old June 30th, 2004, 03:18 PM
Authorized User
 
Join Date: Jun 2003
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Snib for the exellent explanation. Appreciate it.

I got it to work; the script will only run on the prod server.

THanks, and have a great day !





Similar Threads
Thread Thread Starter Forum Replies Last Post
plz.....plz solve out my problem.... kethireddy435 ASP.NET 1.x and 2.0 Application Design 1 October 4th, 2007 12:56 PM
PDF Anchor Problem kwilliams Other Programming Languages 0 January 10th, 2007 11:41 AM
really stupid problem with anchor tags thenoseknows ASP.NET 2.0 Basics 3 August 31st, 2006 09:34 AM
Problem with input type image With Anchor tag vinkumrect Javascript How-To 1 July 21st, 2005 08:59 AM
Date Format - Truncating - Plz Help - THNX ! ank2go VB.NET 2002/2003 Basics 2 March 30th, 2004 11:26 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.