Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search engines and ajax 1

Status
Not open for further replies.

MarkZK

Technical User
Jul 13, 2006
202
GB
Hi, I'm trying to find the best way to display links for search engines and people with javascript disabled without messing the ajax requests up

option 1
Code:
<div id="links">
<a href="test.html">test</a>
</div>
<script type="text/javascript">
document.getElementById('links').innerHTML='<span onclick="ajaxCall(\'test.html\')" class="linkcss">test</a>';
</script>

option 2

Code:
 <div id="links">
<a href="test.html" onclick="ajaxCall('test.html');return false;">test</a>
</div>
(this way works well enough but keeps the test.html in the status bar)

option 3

maybe you know a better way ?

Thanks.
 
I would favour option 2... with a minor alteration so that it is easy to re-use in a generic sense:
Code:
<a href="test.html" onclick="ajaxCall([b]this.src[/b]);return false;">test</a>

Cheers,
Jeff

[tt]Jeff's Blog [!]@[/!] CodeRambler
[/tt]

Make sure your web page and css validates properly against the doctype you have chosen - before you attempt to debug a problem!

FAQ216-6094
 
*lol* That's the third time in as many weeks I've done that very same error. You are of course spot on that I mean this.href [smile]

Cheers,
Jeff

[tt]Jeff's Blog [!]@[/!] CodeRambler
[/tt]

Make sure your web page and css validates properly against the doctype you have chosen - before you attempt to debug a problem!

FAQ216-6094
 
I'm always doing it :) ,thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top