Hello fellow developers

I have a site project I've just acquired for a quick repair and I have problem with the url string being truncated because of the "#".

What I mean by that is if I have a url string with a nave/value pair: deviceNane= AjaxText #2 only the AjaxTest part of the name would show as part of the url string. I tried to put the value in a single or double quotes but still will not work.

Is there a method that I can use to allow the name to be pass on clean?

Recommended Answers

All 5 Replies

what method are you using to gat that url in your string?

I am using javascript to create the url (code as follow)

top.main.location.href="../TrackApp/main.aspx?selectedTab=1&Tab2=0&username=" + username + "&deviceName=" + name + "&deviceUID=" + pid;

you may want to escape values that may contain non-alpha characters. as in

top.main.location.href="../TrackApp/main.aspx?selectedTab=1&Tab2=0&username=" + escape(username) + "&deviceName=" + escape(name) + "&deviceUID=" + pid;

I tried the escape recommendation and it does not work. Any other suggestions.

Hello fellow developers

I have a site project I've just acquired for a quick repair and I have problem with the url string being truncated because of the "#".

What I mean by that is if I have a url string with a nave/value pair: deviceNane= AjaxText #2 only the AjaxTest part of the name would show as part of the url string. I tried to put the value in a single or double quotes but still will not work.

Is there a method that I can use to allow the name to be pass on clean?

Take a look at the window.location object:
https://developer.mozilla.org/en/DOM/window.location

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.