?
Solved

Authenticate browser then open page

Posted on 2014-11-12
8
Medium Priority
?
94 Views
Last Modified: 2015-01-02
I have a coldfusion page that needs to have a user authenticated on another application.  Right now the user has to click the link on my page once then the link does not fully function as the user is first logged on.  What I would like to have javascript open the page, verify no 404 or other server error, then reopen the same page.  Is this possible?
0
Comment
Question by:atljarman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 9

Expert Comment

by:Mukesh Yadav
ID: 40437128
Hmmm...
0
 
LVL 84

Accepted Solution

by:
Dave Baldwin earned 2000 total points
ID: 40437140
I don't think that will work.  A quick search doesn't find any way for javascript to read the HTTP status codes.  A 404 page is just another page to javascript.
0
 

Author Comment

by:atljarman
ID: 40437160
Maybe just waiting til page opens, close it, then reopen the same page?
0
WordPress Tutorial 1: Installation & Setup

WordPress is a very popular option for running your web site and can be used to get your content online quickly for the world to see. This guide will walk you through installing the WordPress server software and the initial setup process.

 
LVL 84

Expert Comment

by:Dave Baldwin
ID: 40437174
I don't understand your process but it doesn't sound like javascript will do what you want.  You might as well try it though.  At least then you'll know.
0
 
LVL 1

Expert Comment

by:bjmurray
ID: 40470989
As per previous, im not quite sure what your asking for, but her it goes.

I'm pretty sure it can be done asynchronously using a jquery ajax call

http://api.jquery.com/jquery.ajax/

Scroll down to where is says "statusCode"

For example:
$(document).ready(function() {
	$.ajax({
		type:'GET',
		url: window.location.href, // OR the page you want to check for 404, 500 etc.
		statusCode: {
			500:function() {
				alert('HTTP 500 Error has occurred.');
			},
			404:function() {
				alert('HTTP 404 Error has occurred.');
			},
			200:function() {
				// Everything was ok
				location.reload(); // or redirect to another page
			}
		}
	});
});

Open in new window


I'm not suggesting this a best practice approach or wether or not it will work, but this is a good place to start looking and by all accounts it should be close to a solution.

It also suggests that the same thing could be done with vanilla JavaScript.

Regards
0
 

Author Comment

by:atljarman
ID: 40471156
Thanks.  I was thinking Along these lines and will try your suggestion Monday or Monday night.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
This article discusses how to implement server side field validation and display customized error messages to the client.
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question