GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   making clickable link without http part? (https://gfy.com/showthread.php?t=860755)

xxweekxx 10-09-2008 01:32 PM

making clickable link without http part?
 
is it possible to make a working link without the http part??

example:

<a href="www.google.com"> test </a>

obviously if u put that in a html file it wont work....

BradM 10-09-2008 01:32 PM

No, it's not possible.

CyberHustler 10-09-2008 01:34 PM

I think only if you're linking to a page on the same site. You can use a /

xxweekxx 10-09-2008 01:34 PM

kinda sucks.. so u must put the "http" part.. eh

Brad Gosse 10-09-2008 01:36 PM

the only way would be to use an htaccess redirect but the http:// would need to be in htaccess

grumpy 10-09-2008 01:51 PM

why would you wanna do that?

HomerSimpson 10-09-2008 02:28 PM

Quote:

Originally Posted by grumpy (Post 14875681)
why would you wanna do that?

yeah?
what's the deal about it?
what are you trying to achieve?

calmlikeabomb 10-09-2008 03:14 PM

Yes, but it involves intercepting the click event with JavaScript.

Essentially, you need http://, but it's possible without altering the markup that you provided above. All of your links could look like what you described.

Only a few lines of code assuming you're a JavaScript ninja armed with jQuery.

seeandsee 10-09-2008 03:19 PM

i hate that shit too, few times i make such links in html source and then i get www . mysite . com / www . thaturlfucking . com . html

calmlikeabomb 10-09-2008 04:52 PM

so why do you wanna do this..?
 
http://calmdev.com/gfy/click.php

i wouldn't suggest using js for the task, but it's possible...

Code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>Intercept Click</title>
    <script type="text/javascript" src="http://assets.fit.edu/src/js/jquery/jquery.js"></script>
    <script type="text/javascript">
    $(document).ready(function(){
        $('a').click(function() {
            document.location = 'http://' + $(this).attr('href');
            return false;
        });
    });
    </script>
</head>
<body>
    <a href="www.google.com">Google</a>
</body>
</html>



All times are GMT -7. The time now is 07:13 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123