473,322 Members | 1,540 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

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

16
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
Oct 30 '08 #1
11 1926
gits
5,390 Expert Mod 4TB
yes ... just use a POST request ... i think this is what you want ;) ... you may have a look here for a start ...

kind regards
Oct 30 '08 #2
zanzo
16
actually I changed the ajax call to post, but I still can see the parameters in the URL!!!!
Oct 30 '08 #3
gits
5,390 Expert Mod 4TB
without having a look at what you have done it is hard to tell anything about this problem ;) ... please show the relevant parts of the code where you 'load up' the request ...

kind regards
Oct 30 '08 #4
zanzo
16
Expand|Select|Wrap|Line Numbers
  1. bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
  2. page_request.open('POST', url, true)
  3. page_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  4. page_request.setRequestHeader("Content-length", bustcacheparameter.length);
  5. page_request.setRequestHeader("Connection", "close");
  6.  
  7. page_request.send(bustcacheparameter)
Oct 30 '08 #5
zanzo
16
Expand|Select|Wrap|Line Numbers
  1. page_request.onreadystatechange=function(){
  2. loadpage(page_request, containerid)
  3. }
  4.  
  5.  
  6.  
  7. function loadpage(page_request, containerid){
  8. if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))
  9. document.getElementById(containerid).innerHTML=page_request.responseText
  10. }
Oct 30 '08 #6
zanzo
16
now it is working but not in the all pages :s

I'm using AJAX for paging, and i have 2 paging in the page (on in the top and other in the footer), the footer paging is working, the other no!!

what could be the problem with that
Oct 30 '08 #7
gits
5,390 Expert Mod 4TB
glad to hear that it works a bit ;) ... but now again ... i need more info regarding this new problem: how many requests are started at once? do you use a global request-reference? may be you start a request and just abort a running one with reusing the reference for a new one? this is most likely the problem - you could test it with seperating the requests, just avoid the footer-request and see whether the code works ... if it works you just need to use different references (variables) instead of only one global for your requests.

kind regards

PS: and please use the CODE tags when posting source-code
Oct 30 '08 #8
zanzo
16
Well everything now is working :D thanks a lot for your help gits ;)

ok next time I will use the CODE tags when posting source-code ;)
Oct 30 '08 #9
gits
5,390 Expert Mod 4TB
no problem, you are welcome ... could you just drop a short note about the solution? what was the problem and how did you solve it ... so that other users with similar problems that might read this thread in the future might see what the problem/solution was?

kind regards
Oct 30 '08 #10
zanzo
16
ok have no problem,

first as i was using the Get method when requesting variables i used $_GET, while now it should be $_POST, also I should send some parameters in the url like "id" depending on the page, before using the post method i didn't have this prob.
Oct 30 '08 #11
gits
5,390 Expert Mod 4TB
thanks for taking time to share your solution ... hopefully this might help users with similar problems in the future ;)

kind regards
Oct 30 '08 #12

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Dariusz | last post by:
I have a problem where I need to pass two variables using GET from a form I have, to solve a page selection problem I have. The code is written that if a new visitor arrives at the front page of...
0
by: Ben | last post by:
Hi All, I have a web app which uses Frames, frame 1 with search criteria(1.aspx) and frame 2 with results(2.aspx). Frame2 in turn posts to a servlet(action="servlet URL") and the report parameters...
4
by: teren | last post by:
Hi all, I would like to send a user who lands on page.php to page2.php with some hidden variables (similar to post method). I assume the header redirect will only pass visible variables...
11
by: Frankie | last post by:
Hello: New user here...first post to group. I'm getting an SQL syntax error when I try to run the following query: $query = sprintf("SELECT itemNumber, entryDate, modifyDate, thumbnailURL,...
3
by: prabodhtiwari | last post by:
function submitPartsForm(str) { var count=document.getElementsByName("partId"); for(var i=0;i<count.length;i++) { document.mylist.myNum.value= document.getElementsByName("partNum")...
6
by: =?Utf-8?B?U2hhd24gU2VzbmE=?= | last post by:
Greetings! I was researching AJAX to provide a solution to displaying status messages while a long process executed. I found several examples online and was able to use their code to get a quick...
2
by: scout3014 | last post by:
Hi all I need help on one matter here. I have a php file which takes values from the form which calls the page and displays it for confirmation. I try to display using this: From: <input...
4
by: virtualweb | last post by:
Not able to pass variables data: Hello .. Im building a form that uploads files with encType="multipart/form-data" but on the same form I need to pass other variables with hidden fields. The...
8
by: jkbhanuprakashreddy | last post by:
Can some one help me how to send hidden variables in a URL?
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.