Webmaster Forum


Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Coding Forum Problems with your code? Let's hear about it.

Lionsanime Directory   World's Leading Outsourcing Network   V7N Directory

Reply
 
LinkBack Thread Tools Display Modes
Old 04-19-2008, 01:21 PM   #1 (permalink)
Junior Member
 
Join Date: 04-19-08
Posts: 3
iTrader: 0 / 0%
Latest Blog:
None

Vandtekor is liked by many
Thumbs down Need help with AJAX please!

Hi,

I have a problem regarding AJAX that I really need solving - any help would be really much appreciated!

Problem:
Currently, when a user enters the wrong URL on my site, they just get my standard custom 404 page that is static, and just says that the file couldn't be found. I however need it to display the URL that the client entered that caused the 404, and, while I could do this really easily with a server side script, heres the catch. I need it to be done on the browser side.

So I need a piece of AJAX JS that sits in my custom 404 page, and when the page is called, is executed on the client, asks my server what page caused the 404, and displays the URL.

I hope it's possible! Thanks in advance for any help given!
Vandtekor is offline  
Add Post to del.icio.us
Reply With Quote
Sponsored Links
SEO Hosting by HostGator  Advertise Here  Buy Blog Links
Old 04-19-2008, 10:02 PM   #2 (permalink)
v7n Mentor
 
Costin Trifan's Avatar
 
Join Date: 04-13-07
Location: Romania
Posts: 2,939
iTrader: 0 / 0%
Costin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web pro
why not trying to see if the url exists before navigating to that specific page? then you'll know if the page exists, and if it doesn't you just show the input url. (no need to go to the 404 page anymore)
__________________
JUNE - JavaScript Framework
Costin Trifan is offline  
Add Post to del.icio.us
Reply With Quote
Old 04-20-2008, 01:11 AM   #3 (permalink)
Contributing Member
 
Bagi Zoltán's Avatar
 
Join Date: 11-28-06
Location: Hungary
Posts: 195
iTrader: 1 / 100%
Bagi Zoltán is liked by somebodyBagi Zoltán is liked by somebodyBagi Zoltán is liked by somebodyBagi Zoltán is liked by somebodyBagi Zoltán is liked by somebody
Quote:
Originally Posted by Vandtekor View Post
So I need a piece of AJAX JS that sits in my custom 404 page, and when the page is called, is executed on the client[/b]
Code:
<script language="javascript"> document.write("The requested " +location.href + " was not found on the host"); </script>
This write the requested URI.
__________________
eCommerce shopping cart :: seo directory
Bagi Zoltán is offline  
Add Post to del.icio.us
Reply With Quote
Old 04-20-2008, 01:51 AM   #4 (permalink)
Junior Member
 
Join Date: 04-19-08
Posts: 3
iTrader: 0 / 0%
Latest Blog:
None

Vandtekor is liked by many
Great! Thanks a lot. How could I not see such an simple solution! Excellent, that's made my day.

Thanks again!
Vandtekor is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum

Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Add AJAX? birdbrain24 Coding Forum 1 02-05-2008 10:03 AM
AJAX: bots hitting AJAX scripts kkiely Coding Forum 1 04-21-2007 01:14 AM
AJAX in IE7 help SasaVtec Coding Forum 1 01-12-2007 11:53 AM
AJAX Bredd S Webmaster Revenue 4 08-09-2006 12:59 PM
AJAX kwvarga Coding Forum 8 12-18-2005 09:24 PM


Sponsor Links
Get exposure! Get exposure! Find Scripts Web Hosting Directory Get exposure! SEO Blog


All times are GMT -7. The time now is 12:52 PM.
© Copyright 2008 V7 Inc