PDA

View Full Version : Masking Link with onclick


mal
03-30-2005, 08:20 PM
Hi,

I have an issue, where I am using the onclick event to mask the url that shows in the status bar - thing is that it doesnt mask it until I refresh the page . . . or click on it once. The first time it still shows the url in the status bar when clicked. I looked at other people's examples and they had this same problem.

Here is my code.

<a href="http://www.url.com" onmouseover="status='This can happen if you want when someone mouses over a link'; return true;" onclick="status='This can happen if you want when someone clicks the mouse'; return true;">Mouseover Here</a>

Is there a way to fix this?

Thanks

Kor
03-31-2005, 08:59 AM
but why to hide the status onclick... as onclick will open that url anyway? :D

On the other hand, as a user i would definitely don't like to have the status bar hidden. It is at least not polite if not even worse... I usually don't follow the hided status links. I always want to know where I am to go

mal
04-01-2005, 05:11 AM
My client's request.

glenngv
04-01-2005, 05:55 AM
Maybe you can explain to your client in a nice way that even if you can hide the url on onmouseover, it's still possible to see it through several easy ways. Tell them that it's better to concentrate on important aspects of the project rather than spend a lot of time and money doing useless things.

scatrbrain
05-17-2005, 04:23 AM
but why to hide the status onclick... as onclick will open that url anyway? :D

On the other hand, as a user i would definitely don't like to have the status bar hidden. It is at least not polite if not even worse... I usually don't follow the hided status links. I always want to know where I am to go


I have a webcam site which uses iframes that hides the actual URL of the video windows which reside on my computer, this keeps "most" people from seeing my IP address and the directory where the pages are, of course there are ways to get this info if you really want it but i have made it as difficult as possible. In fact you cant read my source unless you pull it from your IE temp files because you cant right click, and you cant use the view drop down menu to see the source since the actual page is behind an iframe. So you see I have a legitimate reason for wanting to hide this info, and the end user can not tell that the video window is embeded and actually resides somewhere else. The only time this info is exposed is when they hover or click the links to load the video windows. So theres one answer to the question, why hide the status when the link takes you there anyway :-)

Kor
05-17-2005, 08:47 AM
I see your point, but you must think a little deeper. It is a little paradox round here. You try to hide your url from people, but people whom might be interested in your URL are, mostly, people with rather high Web knowledges, so that it will be quite easy for them to bypass your "protection".

See that it is quite usless to try to hide something using low secure languages such as javascript. Javascript is a client-side language and it was designed for anything else than for protecting sources... ;)

glenngv
05-17-2005, 09:38 AM
In fact you cant read my source unless you pull it from your IE temp files because you cant right click, and you cant use the view drop down menu to see the source since the actual page is behind an iframe.
You can. Just view the source via the menu to see the src attached to the iframe, then access the page directly from the browser. Now you can see the source of the page. Not difficult to do. :rolleyes:

And there also view-source bookmarklets littering here in CF and the web. Actually I modified one to allow to view source of target frame/iframe. I used this in debugging my scripts.

IE:javascript:ans=prompt('Specify%20name%20of%20target%20window/frame/iframe.%20Empty%20or%20non-existing%20name%20will%20mean%20current%20topmost%20window.','');win=window[ans];if(!win)win=top;myWin=window.open('','','width=800,height=600,scrollbars,resizable,menubar');myStr= win.document.documentElement.outerHTML;myStr=myStr.replace(/\</g,'&lt;');myWin.document.open();myWin.document.write('<pre>'+myStr+'</pre>');myWin.document.close();

Moz:javascript:ans=prompt('Specify name of target window/frame/iframe. Empty or non-existing name will mean current topmost window.','');win=window[ans];if(!win)win=top;myWin=window.open('','','width=800,height=600,scrollbars,resizable,menubar');myWin. document.write('<pre>' + unescape((new XMLSerializer()).serializeToString(win.document).replace(/</g, '&lt;')) + '</pre>');myWin.document.close()
Remove unwanted space put by this forum when posting long lines of code.

scatrbrain
02-04-2006, 10:54 PM
Well, since last may, and after thousands of visitors, its true that savvy web users can see the true URL of a hidden i frame, but since i started using the iframes to hide my IP address, guess how many people have bookmarked and returned directly to my IP address, by bypassing the main page... Zero.. so using this methed is 1000 times better than not using it in my case..