usually we create a url with parameters and values and send it via ajax to not loading page.

Is there a way to not send variables in the url BUT using hidden variables??

I have a problem in my website that doesn't permit me to send variable in url, so the ajax is not working anymore:

the problem is when i choose a language and the url become like this:
http//..../en/page -->here it is impossible to add variables to the url and success

is there a way to solve this issue??

hope i do get help :(

Best regards,
zanzo

> here it is impossible to add variables to the url and success

Why is it impossible?

What prevents you from creating a URL of the form http://somesite.net/en/page?name=somename&age=someage ?

Anyways, if the operation involves POSTing data rather than GETting it, consider using POST requests rather than GET ones when making asynchronous calls.

Because, I'm using writing rule, i can't add "?name=somename&age=someage" to url!!
maybe if i add this parameters to the writing i can solve the problem??
/en/somename/someage/page!!

You have two options:
- Either come up with intelligent URL rewriting rules so that situation as mentioned above can be effortlessly handled. I am sure it can be, it just requires a bit of tact with regular expressions, that's all.
- Use the POST method when making asynchronous calls; this isn't as such recommended if you are trying to get some query results.

I think I will try the first option, as I'm using ajax and can't use post method!!

> I'm using ajax and can't use post method!!

Technically, you *can* use the POST method when using Ajax, there is nothing which prevents you from doing so; whether it pertains to your application/business is another question.

I tried to put "post" instead of "get" in ajax but still it sends the parameters in the url!! :S

Trial and error has little place in programming; get a good book or a solid online reference (MSDN or Mozilla tutorials) and learn more about Ajax.

Thanks for ur advices, I solved the bug ;)

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.