Click here to Skip to main content
15,925,309 members
Home / Discussions / JavaScript
   

JavaScript

 
GeneralRe: Learning jQuery Pin
Richard Deeming27-Jan-14 10:05
mveRichard Deeming27-Jan-14 10:05 
AnswerRe: Learning jQuery Pin
Graham Breach27-Jan-14 9:44
Graham Breach27-Jan-14 9:44 
QuestionDuplicate File Remover Code Pin
Rahul Michael26-Jan-14 18:10
Rahul Michael26-Jan-14 18:10 
QuestionRe: Duplicate File Remover Code Pin
Richard MacCutchan26-Jan-14 21:53
mveRichard MacCutchan26-Jan-14 21:53 
AnswerRe: Duplicate File Remover Code Pin
Rahul Michael27-Jan-14 6:09
Rahul Michael27-Jan-14 6:09 
GeneralRe: Duplicate File Remover Code Pin
Richard MacCutchan27-Jan-14 6:35
mveRichard MacCutchan27-Jan-14 6:35 
GeneralRe: Duplicate File Remover Code Pin
Thomas Daniels27-Jan-14 6:26
mentorThomas Daniels27-Jan-14 6:26 
QuestionAnyone can help me? Pin
ArjanD21-Jan-14 8:44
ArjanD21-Jan-14 8:44 
SuggestionRe: Anyone can help me? Pin
Richard Deeming21-Jan-14 10:15
mveRichard Deeming21-Jan-14 10:15 
QuestionHelp with my statement. Pin
Yhen Caisip18-Jan-14 16:56
Yhen Caisip18-Jan-14 16:56 
AnswerRe: Help with my statement. Pin
Peter Leow18-Jan-14 18:00
professionalPeter Leow18-Jan-14 18:00 
GeneralRe: Help with my statement. Pin
Yhen Caisip18-Jan-14 20:25
Yhen Caisip18-Jan-14 20:25 
GeneralRe: Help with my statement. Pin
Peter Leow18-Jan-14 20:29
professionalPeter Leow18-Jan-14 20:29 
GeneralRe: Help with my statement. Pin
Yhen Caisip18-Jan-14 20:48
Yhen Caisip18-Jan-14 20:48 
GeneralRe: Help with my statement. Pin
Peter Leow18-Jan-14 21:04
professionalPeter Leow18-Jan-14 21:04 
GeneralRe: Help with my statement. Pin
Yhen Caisip18-Jan-14 21:27
Yhen Caisip18-Jan-14 21:27 
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 

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.