IT Community - Software Programming, Web Development and Technical Support

How to indimate a link is opened or not?

This is a discussion on How to indimate a link is opened or not? within the HTML, CSS and Javascript Coding Techniques forums, part of the Web Development category; Hi all, I'm creating a html page..there is lot of links..I need to check the links opened ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > HTML, CSS and Javascript Coding Techniques

Register FAQ Members List Calendar Mark Forums Read
  #1  
Old 09-27-2007, 11:10 PM
S.Vinothkumar S.Vinothkumar is offline
D-Web Genius
 
Join Date: May 2007
Posts: 905
S.Vinothkumar is on a distinguished road
Question How to indimate a link is opened or not?

Hi all,

I'm creating a html page..there is lot of links..I need to check the links opened or not.

check my coding,

<html>
<head>
<title></title>
</head>
<body>

<A HREF="http://google.com" TARGET="NewTarget" onClick="window.focus() Window.open('http://google.com', 'NewTarget') return false;">
Google</A>
<br/>
<A HREF="http://gmail.com" TARGET="NewTarget" onClick="window.focus() Window.open('http://gmail.com', 'NewTarget') return false;">
Gmail</A>
<br/>
<A HREF="http://yahoo.com" TARGET="NewTarget" onClick="window.focus() Window.open('http://yahoo.com', 'NewTarget') return false;">
Yahoo</A>
<br/>

<A HREF="http://Discussweb.com" TARGET="NewTarget" onClick="window.focus() Window.open('http://Discussweb.com', 'NewTarget') return false;">
Discussweb</A>
<br/>
<A HREF="http://msn.com" TARGET="NewTarget" onClick="window.focus() Window.open('http://msn.com', 'NewTarget') return false;">
MSN</A>
<br/>
</body>
</html>

This code doesn't work...I'm not knowing where I'm wrong...

Is there any Idea?
__________________
S.VinothkumaR
Behind me is infinite power,
Before me is Endless Possibility,
Around me is Boundless Opportunity,
Why should I fear!
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2  
Old 09-28-2007, 11:12 PM
amansundar amansundar is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 319
amansundar is on a distinguished road
Wink Re: How to indimate a link is opened or not?

So you want to open a new window for each link?

If that is the case, you would need to name each window differently.

eg

Window.open('http://your link', 'Name1');
Window.open('http://your link', 'Name2');

etc...

I think this is what you mean?

If not let me know in a bit more detail.
__________________
cheers
Aman
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3  
Old 10-03-2007, 07:36 AM
S.Vinothkumar S.Vinothkumar is offline
D-Web Genius
 
Join Date: May 2007
Posts: 905
S.Vinothkumar is on a distinguished road
Question Re: How to indimate a link is opened or not?

Thank u buddy,

Each link should open in a same named target window, thats y i gave the same target name for each link. The problem is first time if u click any one of the link it will open a new window, after second time it will open the same window, but we dont know whether it is opened or not, so i need to indicate to the user link that named browser blinking in taskbar or appear on the screen. It will help to user to know whether the new link is opened.

the function Window.focus() will help to do this. I tried, but i didn't get result.
__________________
S.VinothkumaR
Behind me is infinite power,
Before me is Endless Possibility,
Around me is Boundless Opportunity,
Why should I fear!
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4  
Old 10-06-2007, 03:30 AM
amansundar amansundar is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 319
amansundar is on a distinguished road
Cool Re: How to indimate a link is opened or not?

Hi buddy,

Use as follows,


Code:
<html>
<head>
<title></title>

<script type="javascript">
var newWindow = false;

function toggleWindow(url)
{
       // Check if window is or has been open already and make sure it has not been closed
       if (newWindow && newWindow.open && !newWindow.closed)
       {
          // Change the URL and give the window focus
              newWindow.location.href = url;
              newWindow.focus();
       } else {
          // Otherwise open the window and give it focus
          newWindow = window.open(url, 'newWindow');
          newWidnow.focus();
       }
}
</script>
</head>
<body>

<!-- Now put the function call on each linke //-->
<A HREF="http://google.com" TARGET="NewTarget" onClick="toggleWindow('http://google.com') return false;">
Google</A>
<br/>
<A HREF="http://gmail.com" TARGET="NewTarget" onClick="toggleWindow('http://gmail.com') return false;">
Gmail</A>
<br/>
<A HREF="http://discussweb.com" TARGET="NewTarget" onClick="toggleWindow('http://discussweb.com') return false;">
discussweb</A>
<br/>

<A HREF="http://yahoo.com" TARGET="NewTarget" onClick="toggleWindow('http://yahoo.com') return false;">
Yahoo </A>
<br/>
<A HREF="http://msn.com" TARGET="NewTarget" onClick="toggleWindow('http://msn.com') return false;">
msn</A>
<br/>
</body>
</html>
__________________
cheers
Aman
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5  
Old 10-06-2007, 03:50 AM
S.Vinothkumar S.Vinothkumar is offline
D-Web Genius
 
Join Date: May 2007
Posts: 905
S.Vinothkumar is on a distinguished road
Question Re: How to indimate a link is opened or not?

Thanks for send this code.

But code is not focussing the inactive (minimized) window.
__________________
S.VinothkumaR
Behind me is infinite power,
Before me is Endless Possibility,
Around me is Boundless Opportunity,
Why should I fear!
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6  
Old 10-06-2007, 04:05 AM
amansundar amansundar is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 319
amansundar is on a distinguished road
Wink Re: How to indimate a link is opened or not?

The function from my last post does the same thing as the code you posted.

The call to newWindow.focus() is the only thing I know and it doesn't work on all browsers/OS etc.

You would be better off closing the window and opening again each time you run the function.
Code:
var newWindow = false;

function toggleWindow(url)
{
       // Close3 the window if its already open.
       if (newWindow && newWindow.open && !newWindow.closed)
       {
          newWindow.close();
} 

          newWindow = window.open(url, 'newWindow');
          newWidnow.focus();
}
__________________
cheers
Aman
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
The theme is opened completely and very actual! BKOsuper Server Management 0 12-04-2008 12:08 AM
How to move a PopUp div to be opened at desired location? poornima ASP and ASP.NET Programming 2 03-17-2008 07:50 PM
html link with Php Archimedees PHP Programming 1 09-11-2007 03:05 AM
Three Way Link Exchange? Joe Search Engine Optimization 0 02-23-2007 06:07 AM


All times are GMT -7. The time now is 09:42 AM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.
Our Partners
One Way Moving Companies | Stamford Dentist | Euro Millions Lottery | Home Loans| Furniture

SEO by vBSEO 3.0.0