Jump to content

Inconsistent Javascript Behavior


Recommended Posts

Hello,
 
I'm trying to follow the example at: 
http://howto.caspio.com/tech-tips-and-articles/common-customizations/create-user-specific-redirect-after-login/

Here's what my code looks like:

<script>

alert("[@authfield:Admin]" );
alert("[@authfield:username]" );
alert("[@authfield:pass]" );
alert("[@authfield:email]" );

alert("hello");

if("[@authfield:Admin]" == "Yes"){
window.location = "http://www.mydomain.org/admin.html";
}
else{
window.location = "http://www.mydomain.org/regular.html";
}

</script>

I've been tweaking this code a bunch, to get it to work right.  What's strange is that sometimes it works as expected.  I sign in as an admin user, I see the alerts and I go to the admin page.  Sometimes, I sign in as an admin user, I do not see any alerts and I go to the regular page, which is the behavior I would expect if it were using a version of my html page from earlier today. 
 
Sometimes, if I sign in as a regular user, I see the alerts and get taken to the regular page, sometimes I see no alerts and get taken to the regular page, which is what I would expect if I were using an older version of the page.
 
What the behavior looks like to me is that caspio has some kind of server farm and some of them are serving older versions of the page.  I can't see how else I'd be getting alerts sometimes and not other.  Does anyone have another explanation?  I've tried clearing my IE cache and disabling it.  I've tried Chrome.  It does the same thing either way.  I'm not seeing the html from my page in a fiddler trace, so it's hard to tell what's going on.
 
-Charlie

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...