How to hide variables in the url javascript?

Posted on 2009-04-27
Last Modified: 2012-05-06

I have this url:

I dont want to display formdate1 and formdate2 variable and values in the url. Would you please hide it using javascript.

Question by:Saroj13
    LVL 2

    Expert Comment

    You can set the form action to be Post instead of Get, That will hide the parameter strings.

    Else, if you are using C#, as your backend, then use the Server.Transfer method to your new result page, which will not only hide the request string, but also the .aspx nam eof the new page you are opening.


    Author Comment

    I need to use get method only. also, i am not using c#.
    LVL 2

    Accepted Solution

    Then use Ajax XMlHttpRequest and the XMLHttpResponse object to track page state changes.

    The following page has a simple example:

    (page courtesy - the first hit when search for "Simple Ajax Example" by Google)


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Suggested Solutions

    Avoid defining the variables in the global scope; trying to define them in a local function scope. Because:   • Look-up is performed every time a variable is accessed.   • Variables are resolved backwards from most specific to least specific scope…
    This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
    The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
    The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

    759 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

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now