Results 1 to 3 of 3

Thread: window.location not working in firefox

  1. #1
    Join Date
    Sep 2013

    window.location not working in firefox

    Hi there

    I have an Image button which should redirect the user to a page where search results are displayed.

    HTML Code:
    <input type="text" id="txtSearchGeneral" class="input-medium search-query" placeholder="Search ..." />
                        <input type="image" name="btnSearchTest" src="Images/searchIcon.png" width="16" height="20" />
    The function I am usinng for the purpose of redirecting is the following

    $(document).on("click", "input[name='btnSearchTest']", function () {
        var txtBoxValue = $('#txtSearchGeneral').val();
        if (txtBoxValue == "") {
            alert("Please enter a value");
            return false;
        window.event.returnValue = false;
        //window.location.href = "SearchResults.aspx?search=" + txtBoxValue;
        //window.location = "SearchResults.aspx?search=" + txtBoxValue;
        //document.location = "SearchResults.aspx?search=" + txtBoxValue;
        //window.location.assign("SearchResults.aspx?search=" + txtBoxValue);
        window.location = "SearchResults.aspx?search=" + txtBoxValue;
        //location.href = "SearchResults.aspx?search=" + txtBoxValue;
    The above works fine in IE and Google Chrome.

    Advice perhaps as to why it is not working in firefox and how I can get this to work?


  2. #2
    Join Date
    May 2006
    Somewhere behind your screen
    try window.location.assign("SearchResults.aspx?search=" + txtBoxValue);
    xxx: Guess Buddhist riddle: "What is the sound of one hand clapping?"
    yyy: facepalm

  3. #3
    Join Date
    Sep 2013
    Suge pula

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center

Recent Articles