Javascript links

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
pearl betting
Forum Newbie
Posts: 3
Joined: Sat Apr 18, 2009 3:23 pm

Javascript links

Post by pearl betting »

Hi All

Just a quick one.

I need to be able to link certain pages of my website on other sites but can't get the code right.

Below is the example of the code :

<item name="Item 04" link="javascript:updateMainContentInfo('sportslist.php?sportId=12');" target=""
which is used in my Dreamweaver and which works when I'm on my site ie : I can open these links on my website only

However, I do not know how to place this link on other sites.

My website is https://www.pearlbetting.co.za.

Thanks
User avatar
kaszu
Forum Regular
Posts: 749
Joined: Wed Jul 19, 2006 7:29 am

Re: Javascript links

Post by kaszu »

To put a link some else site you need a permanent url to go to, like "https://www.pearlbetting.co.za/SOMETHING".
Example: viewforum.php?f=13 <- it will go to Javascript forum in this forum, if you post this link on some other website, it will work and user will get to that forum.

Problem with your website is that it is only 1 page (which can be found here https://www.pearlbetting.co.za) and all other content is retrieved with javascript, but there are no pages where that content could be found.
Even if you could post that 'item' (in HTML there is no such tag, but is used 'A' tag), it wouldn't work, because it's a call to javascript function, not an actual url where users could go.

Please see http://james.padolsey.com/javascript/gr ... l-matters/ it should explain even to non-programmers why having website, which works only with javascript enabled is bad.

Basic answer: you currently can't, because of bad decision made during development of your website!
There is a quick workaround using hash string to save location, but it won't solve all the issues.

Off topic: seeing websites like these makes me :banghead: :evil:
pearl betting
Forum Newbie
Posts: 3
Joined: Sat Apr 18, 2009 3:23 pm

Re: Javascript links

Post by pearl betting »

Thanks Kaszu

Imagine how I feel with a site I can basically do nothing with ?!! Followed my designer's advice about the single page site - but obviously it's back to the drawing board.

Thanks for the advice and will check out those other links
User avatar
kaszu
Forum Regular
Posts: 749
Joined: Wed Jul 19, 2006 7:29 am

Re: Javascript links

Post by kaszu »

What currently can be done is use url like https://www.pearlbetting.co.za#soccer and when page loads check with javascript for hash and load corresponding content.
pearl betting
Forum Newbie
Posts: 3
Joined: Sat Apr 18, 2009 3:23 pm

Re: Javascript links

Post by pearl betting »

Thanks Kaszu but still the same story
beatrizam
Forum Newbie
Posts: 1
Joined: Fri Jul 03, 2009 6:57 am

Re: Javascript links

Post by beatrizam »

How do I find objective spread betting information? I've browsed a lot of spread betting websites and they all cover spread betting to a certain extent, but I'm looking for a great website covering financial spread betting in detail, any recommendations?
_____________
market samurai ~ marketsamurai ~ marketsamurai.com
Post Reply