[jQuery] Selection from a list should rewrite the page.
I'm building a select from a java Resultset for a given userID. Where the value for the options are a recordD for each record in the Resultset. On loading of the page, it gets a userID and recordD from session. If recordD=null then it uses the first record from the Resultset. So the select contains all records for a given userID and the page is populated from data asscoiated to a recordD. Interaction: The user can repopulate the page by making a selection. I makes an AJAX to a sevrlet that reset the session attribute for the recordD. So that when the callback() is called it triggers the page reload. It seems trivial but it is as if the callback() is triggered before the session is written. I have a session and request dumper upon writing the page and I'm not seeing the session modified. I know the the url parameters are being built because I have an alert to display them. $('#select_note').change(function() { // Get the index of the selected item INDEX = $("#select_note option").index($("#select_note option:selected")) +1; RID = $("#select_note option:selected").val(); document.getElementById("rid").value= RID; document.getElementById("current_note").innerHTML = INDEX; var parameters = 'rid='+ RID + '&state=< %=AdvisorDictionary.STATE_GETRECORD%>'; var url = "<%=context%>/secure/Submit"; var GO2TAB = function (url, parameters) { http_request = false; if (window.HttpRequest) { // Mozilla, Safari,... http_request = new HttpRequest(); if (http_request.overrideMimeType) { http_request.overrideMimeType('text/xml'); } } else if (window.ActiveXObject) { // IE try { http_request = new ActiveXObject("Msxml2.HTTP"); } catch (e) { try { http_request = new ActiveXObject("Microsoft.HTTP"); } catch (e) {} } } if (!http_request) { alert('Cannot create XMLHTTP instance'); return false; } http_request.onreadystatechange = alert("Yes"); http_request.open('POST', url + parameters, true); http_request.send(null); } });
[jQuery] I saw the post out at Klaus Hartl's blog. (see below) And it is very close to the question that I have.
I saw the post out at Klaus Hartl's blog. (see below) And it is very close to the question that I have. I'm new to the jQuery sytax and terminology. I'm a Java/Javascript web application programmer here at University of Wisconsin-Madison. Our apps are run from a java servlet server. Each tab calls a sevlet (i.e. <%=context%>/secure/Browse) that renders the html for the container. 1. What we want to do is also trigger an Ajax request and have the response be returned to another tab. 2. Or just be able to trigger a tab change from inside the content without the trip to the server. I'm reading the documention and finding it difficult to understand some of the terminology and syntax of jQuery. Is ther any sample code that would demonstrate the building of the anchors that I could reverse engineer to understand the processing? If someone has a functional site with this type of navigation I would be interested is seeing the HTML. Sincerely David Parker Advisor Notes <% String context = request.getContextPath(); %> $(function(){ $('#an_tabs').tabs(); }); body{ font: 9pt sans-serif; margin: 0px;} #an_container {float: left;width: 400px; } #an_tabs li {font-size: 8pt; } Browse Create Search Preferences Thanks alot. This is great. The only thing that concerns them is the fact that all the content lies on one page (for SEO and PPC reasons they want multiple pages) Is there a way to load external pages (either .asp or .html) into the tab? Thanks so much for this great release. Keonne Comment by Keonne, October 26th, 2007 at 2:50 pm Author Comment Keonne, yes, that’s easy! Just put such links instead of a fragment identifier into the href attribute of the anchors. The plugin recognizes the type of a tab and will load the content via Ajax (I usually call them “remote tabs”). You can even have both types side by side. It’ll also degrade gracefully with JavaScript disabled. The link takes you to the proper page.