Click here to Skip to main content
15,888,351 members
Home / Discussions / JavaScript
   

JavaScript

 
GeneralRe: Help with my statement. Pin
Yhen Caisip18-Jan-14 21:36
Yhen Caisip18-Jan-14 21:36 
GeneralRe: Help with my statement. Pin
Yhen Caisip18-Jan-14 21:51
Yhen Caisip18-Jan-14 21:51 
GeneralRe: Help with my statement. Pin
Yhen Caisip18-Jan-14 23:21
Yhen Caisip18-Jan-14 23:21 
QuestionAdding Var Object to An Array Dynamically Pin
ASPnoob17-Jan-14 9:39
ASPnoob17-Jan-14 9:39 
AnswerRe: Adding Var Object to An Array Dynamically Pin
Graham Breach17-Jan-14 22:15
Graham Breach17-Jan-14 22:15 
GeneralRe: Adding Var Object to An Array Dynamically Pin
ASPnoob18-Jan-14 4:39
ASPnoob18-Jan-14 4:39 
AnswerRe: Adding Var Object to An Array Dynamically Pin
Hassan Oumar Mahamat31-Jan-14 3:24
professionalHassan Oumar Mahamat31-Jan-14 3:24 
QuestionQuery string null in redirects Pin
Vimalsoft(Pty) Ltd15-Jan-14 5:20
professionalVimalsoft(Pty) Ltd15-Jan-14 5:20 
Good Day All

it has been a long day , i hope you had a good one. I am a bit tired, i need some help in the following



I have two pages.On Page 1 there is an onready even and there is a check that i do ,The Check is for a Query string , i am checking the querystring has value like this , if it has a value then redirect to Page2 and Pass the parameter.


JavaScript
function getParameterByName(name) {
         var match = RegExp('[?&]' + name + '=([^&]*)').exec(window.location.search);
         return match && decodeURIComponent(match[1].replace(/\+/g, ' '));
     }


     $(document).ready(function ()
     {
         //Usage
         var message = getParameterByName('cuid');

         if (message != null)
         {
             window.location = "Page2.html?cuid=A1E428F5-6D6B-4A40-854B-3B0E01BBA790";
         }
     });



Now on Page2 i check if there is Query string "cuid" and i check if its not null as i did below



JavaScript
$(document).ready(function ()
      {
          //Usage
          var message = getParameterByName('cuid');
          alert(message);

          if (message == null) {

              window.location = "Page1.html";

          }


      });


if its null i redirect to Page1, now my problem here is that i can see it redirect to Page2 , but immediately it gets redirected to Page1 , the Querystring is null even if i have supplied it.


Please Help



Thanks
Vuyiswa Maseko,

Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.

C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa[at]dotnetfunda.com
http://www.Dotnetfunda.com

QuestionRe: Query string null in redirects Pin
ZurdoDev21-Jan-14 5:04
professionalZurdoDev21-Jan-14 5:04 
Questionconvert krutidev to unicode Pin
Priyanka_a7-Jan-14 22:38
professionalPriyanka_a7-Jan-14 22:38 
QuestionFor non-programmer, Implementing following specific code example - Using JSON and File API to View Starred Google Reader Posts Pin
Member 1048791825-Dec-13 21:24
Member 1048791825-Dec-13 21:24 
SuggestionRe: For non-programmer, Implementing following specific code example - Using JSON and File API to View Starred Google Reader Posts Pin
Richard MacCutchan28-Dec-13 23:29
mveRichard MacCutchan28-Dec-13 23:29 
GeneralRe: For non-programmer, Implementing following specific code example - Using JSON and File API to View Starred Google Reader Posts Pin
Member 104879183-Jan-14 6:01
Member 104879183-Jan-14 6:01 
AnswerRe: For non-programmer, Implementing following specific code example - Using JSON and File API to View Starred Google Reader Posts Pin
Manuel F. Hernandez15-Jan-14 7:33
Manuel F. Hernandez15-Jan-14 7:33 
QuestionTiming issue? Pin
#realJSOP24-Dec-13 5:12
mve#realJSOP24-Dec-13 5:12 
AnswerRe: Timing issue? Pin
twseitex28-Dec-13 8:53
twseitex28-Dec-13 8:53 
QuestionBackbone Pin
Rockerr Black23-Dec-13 22:18
Rockerr Black23-Dec-13 22:18 
AnswerRe: Backbone Pin
Richard MacCutchan24-Dec-13 0:52
mveRichard MacCutchan24-Dec-13 0:52 
AnswerRe: Backbone Pin
Rahul Rajat Singh29-Dec-13 20:50
professionalRahul Rajat Singh29-Dec-13 20:50 
AnswerRe: Backbone Pin
joginder-banger9-Jan-14 22:54
professionaljoginder-banger9-Jan-14 22:54 
QuestionDisplay the server time and refresh every 1 sec using Javascript in asp.net Pin
G.Mariappan(a)Murugan23-Dec-13 18:41
G.Mariappan(a)Murugan23-Dec-13 18:41 
AnswerRe: Display the server time and refresh every 1 sec using Javascript in asp.net Pin
Richard MacCutchan23-Dec-13 22:18
mveRichard MacCutchan23-Dec-13 22:18 
AnswerRe: Display the server time and refresh every 1 sec using Javascript in asp.net Pin
G.Mariappan(a)Murugan23-Dec-13 22:36
G.Mariappan(a)Murugan23-Dec-13 22:36 
AnswerRe: Display the server time and refresh every 1 sec using Javascript in asp.net Pin
joginder-banger9-Jan-14 23:01
professionaljoginder-banger9-Jan-14 23:01 
Questionjquery autocomplete not working though json is success Pin
Member 1047675719-Dec-13 1:17
Member 1047675719-Dec-13 1:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.