JQuery :: Sweep Through Prefixed Html Id's Without Refreshing The Page?
Feb 15, 2011
I've got an order system with a database table column key which is set to 0 by default, in which case the order's html tag has an id prefixed with "transstat-".When the order goes through successfully, it changes the value to 1, in which case the order has no html id tag.The new orders are already in list-style (<ul>/<li>) being "pended" to the monitor page so a complete refresh of the page is out of the solution.
When a new order is shown, it's given a unique id e.g. id="transstat-1023" and then it should check the database every 4-5 seconds to see if the transstat has changed to "1". If so, it should change the html id tag of that order to nothing so that the jquery script skips it at the next sweep for "transstat-".I've tried using the following to search through all the orders with an id that contains "transstat-", but with no luck...
$(document).ready(function() {
tstat0 = setInterval(function () {
$('select[id^="transstat-"]').each(function() {
[code]....
removing the html id tag... but rather the "sweep" that should occur every 4-5 seconds.
View 1 Replies
ADVERTISEMENT
Jan 27, 2011
How do you update the contents of a form from a click of a button? I can poplate the contents of a table that is inside a form on the initial creation of the page
<form id="form1" name="form1" method="post" action="">
<p align="center">
List of Dying Patients
</p> <br><br>
<table border="1" align="center">
<tr>
<td>Last Name</td>
<td>First Name</td>
<td>Middle Initial</td>
<td>Date of Birth</td>
<td>SS Number</td>
<td>Marital Status</td>
<td>Gender</td>
</tr>
<script>
populatePatientsList();
</script>
</table>
</form>
and this is the contents of the function populatePatientList();
for (var x=0;x<mainArr.length;x++) {
document.write("<tr>" +
"<td>" + mainArr[x][0] + "</td>" +
"<td>" + mainArr[x][1] + "</td>" +
"<td>" + mainArr[x][2] + "</td>" +
"<td>" + mainArr[x][3] + "</td>" +
"<td>" + mainArr[x][4] + "</td>" +
"<td>" + mainArr[x][5] + "</td>" +
"<td>" + mainArr[x][6] + "</td>" +
"</tr>");
}
After this the table will have all the contents of the array. How do I reinvoke the form to have the updated version of the array shown on the table without refreshing the whole page? The page cannot be refreshed because the data is just in an array and when I do refresh the page the contents of the array gets back to its default. Is it even possible to refresh just a part of a page, in my case a table after a button click or are there other button events I can try to play with?
View 2 Replies
View Related
Jan 3, 2011
I'm not sure if this is a jQuery issue or an IE9 Preview7 issue, but I'm seeing different behavior with these two methods. I'm trying to apply a scale transform using CSS:
.grow {
-webkit-transform: scale(1.7);
-moz-transform: scale(1.7);
-ms-transform: scale(1.7);
-o-transform: scale(1.7);
transform: scale(1.7);
}
addClass('grow') works fine, but if I try to add the attributes with css({'-ms-transform': 'scale(1.7)'}), it doesn't work. My preference is to use css() since I'm building a plugin and don't want external dependencies.* You can see a repro here: [URL], but it only works as intended (well, the addClass button) in IE9preview7. I'm interested in what jQuery might be doing differently to cause the behavior. I'm also interested in approaches others have used to do scale transforms that have better browser compatibility. I like the css approach so far because it doesn't seem to force the growth of the parent container like it does when I manually change the height and width with jQuery.
* I assume to use addClass, the CSS class has to be in the HTML page or a linked stylesheet. Nowhere to define it in a jQuery plugin, right?
View 1 Replies
View Related
Jun 2, 2011
I came across this product page at nordstrom that allows users to filter products by certain criteria (size, fit, price, etc). [URL]..
They use ajax to update the page with any new criteria that users select, but with each page update the page url also changes and the browser history shows the new page. This is done without refreshing the page.
how this is done: creating a new page in browser history but without refreshing the page?
View 2 Replies
View Related
Oct 31, 2009
Suppose I got two rows like this picture [URL]. I'm trying to change the modified column value to current datetime without refreshing the page when i click the update button. The first row worked,the second doesn't work.
Here is my codes
views/order_home
<script type="text/javascript" src="<?php echo base_url(); ?>js/jquery.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>js/jquery.form.js"></script>
<script type="text/javascript">
// wait for the DOM to be loaded
$(document).ready(function()
{
$("#msg").hide();
$('#myform').ajaxForm(function()
{
var no_id=$('#no_id').val();
$.post("getOrder/", { 'id' : no_id },
function(data){
$('#modif').html(data.modified);
}, "json"); .....
View 1 Replies
View Related
Aug 3, 2011
I'm using PHP in my website, and I don't know how to allowadding comment without refreshing the page to the user(it will appear without refresh)
View 1 Replies
View Related
Jun 22, 2011
i have a slider ( slideup and slidedown of a div box ) and in the div box i have a menu. If i click on the menu the page will refresh and my div box do not show because standart the div box is up ( slidup ). can i make jquery remeber how position is my slide ? if the page do refresh i will see my div box.
View 2 Replies
View Related
Nov 18, 2011
Trying to figure out how to get my simple page re-load to pause for a couple seconds before sending the request. I tried $.wait() and think this could possibly be what I need but seem to not be using it correctly, as I have not had any success getting it to work.
[Code]...
Is there a specific place to put the $.wait()? or should I be using something different entirely to get the script to pause before sending the request to reload?
View 1 Replies
View Related
Jul 20, 2011
I have a query and a php loop that outputs all the rows from a database.
If there is a new entry in the database, how can I use jQuery to update the output without refreshing the page?
View 1 Replies
View Related
Oct 24, 2009
I'm using some jQuery to work with the Last.FM API, and I'm stuck where I need to allow the user to run the JSON request a second time after the page loads (it loads once automatically when the page loads, the second time is when they push a button). What happens currently, is the JSON function is fed some default data when the page loads:
$('#graph').lastFM({
username: 'UserName',
from: 1254369600,
to: 1256184000,
apikey: 'myApiKeyHere',
onComplete: function(){
//Done
}});
The JSON function:
$.fn.lastFM = function(options) {
var defaults = {
username: 'Verdani',
apikey: 'e4f3bb251d13179bf7ce80a089fb3d0c',
onComplete: function(){}
},
settings = $.extend({}, defaults, options); .....
You might have noticed in the JSON, I write the URL the JSON is requesting to the console every time it runs. When I click this button, a new URL pops up in the console below the first one but only for a second, and then the page reloads and the original JSON request is called. It's this loop that I can't seem to break out of - why does re-calling the JSON refresh the page?
View 1 Replies
View Related
Jan 5, 2011
I have created a modal dialog. When I close it the page refreshes automatically but in my scenario the page should not do so. The code I am using is:
$(document).ready(function () {
$("#addaccount").dialog({
height: 'auto',
width: 'auto',
[Code]....
Here I am opening a div tag inside a modal dialog. There is a form submit button. When I click the submit button the modal dialog closes and the page refreshes automatically.
View 2 Replies
View Related
Aug 8, 2011
My programme is to let people play roulette wheel, record their choice of bet, amount of bet, result of bet, number of bets, bet limit. I would like these data being posted to myqsl each time the person bet, without the disruption of page refreshing. I have code as below, but it does not work. There is no error msg, just no data could be inserted.
>>>>>>result.html
input name= "spin" id="spin" type="button" value="spin"onclick="spin();postRecord()">
....
function postRecord() { $.ajax({ type:
[Code]....
View 2 Replies
View Related
Mar 26, 2011
I have a search form that a user selects item from dynamic list hits the submit button and it returns each matchingresulton same page in an update form, i have 2 checkboxes in update form that updates the DB when 1 is checked, this all works fine until i check the checkbox the data updates ok but allremainingupdate forms are removed because the page refreshes.
So i need to update formstwith out page refreshing but i cant get it to work with multiple forms on same page.
View 2 Replies
View Related
Aug 25, 2010
I have a number of pages that organize book data by category and then by unit, chapter, section, etc... Since there is a ton of data I display the headings and hide the rest of the content for the category. When a user clicks the heading then the content for the heading is shown underneath it. This works great and the users don't have to scroll (at least not much in comparison to if everything on the page was visible) unless for some reason they expand tons of stuff.
The problem:My company wants it so that if they expand a bunch of stuff and then browse to another page, that when they click the back button, everything should still be expanded as they left it. The issue is, this content is only available to logged in users and is based on their current location (which they can change at any point), so if their session expires or they logout, using the back button to get to these pages needs to redirect them to the login screen, if they change pages and change their location, going back to this page needs to display the correct content for their location. It is kind of a catch-22. Of course in the eyes of my company "shouldn't it just work that way?"
View 2 Replies
View Related
Feb 9, 2006
When a user clicks the "Close Panel Manager" link on page2.htm I would like page1.htm to be refreshed without losing the address in browser1/page1.htm. Page2.htm is a child popup from parent window page1.htm.
browser2/page2.htm
<A href="javascript:self.close();">Close Panel Manager</a>
browser1/page1.htm
Address: http://www.somewebsite.com?ID=24
View 1 Replies
View Related
Feb 15, 2006
Is it possible to refresh only part of a page rather than reload the
entire thing?
I have dropdown box that's populated from a database using ASP that I
need refreshed but I don't want to reload the entire page.
View 6 Replies
View Related
Jan 27, 2011
My URL is: http://localhost/testproject/product.html#catId=155I want to URL: http://localhost/testproject/product.html without refreshing the page.Is this possible using javascript Or jquery ?
View 3 Replies
View Related
Apr 18, 2009
how to refresh a page when it is visited for the second or more times using javascript.
View 1 Replies
View Related
Nov 30, 2010
Im not sure if im going about this the right way but what I'm trying to achieve is to have my webpage seperated into two main div's.The first div contains a media player so it cant be refreshed or the media stops.The second div is used to view content.I've used innerHTML to change the content of the second div from links in the first.The problem is the URL displayed doesn't reflect the change in content of the second divI want to be able to load content into the second div using innerHTML while changing the URL so people can link directly to that content
View 5 Replies
View Related
Jan 27, 2011
My URL is: http://localhost/testproject/product.html#catId=155I want to URL: http://localhost/testproject/product.html without refreshing the page.Is this possible using javascript/jquery or not ?
View 6 Replies
View Related
Sep 4, 2006
here's a few lines of code I've got in a page that has a php database query in it and I want it to arrive at the anchor link I have called "bottom each time"
<script language="javascript">
function loadPage()
{
location.href = "http://www.mysite.com/help/chat/chat_window.php?theID=<?php echo $id; ?>";
}
</script>
</head>
<body bgcolor="#CCCCCC" onLoad="setTimeout('loadPage()',20000)">
The page has enough data to produce scrollbars. Is there something I'm doing wrong?
View 1 Replies
View Related
Aug 24, 2011
refreshing a page once,twice or so on every given time.. (refresh 1x/30 secs or 2x/40 secs)to make it clear:example i will input 100 on a textbox (so this is my given time) and i will set to refresh the page once,twice and so on in every given time(the 100 i have inputed)
View 2 Replies
View Related
Nov 14, 2008
The user enters their info, the info is sent to the php page through ajax, the php checks if the input fields are empty and checks if the info is correct.If fields are empty or the info is wrong, it updates a div layer with an error message telling them what is wrong.
My problem though is if the user enters correct info. If the user enters correct info I want the main page (index.php) to be refreshed (This is the page with the original form on it).This is my java script:
function createRequestObject() {
var ro;
var browser = navigator.appName;
if(browser == "Microsoft Internet Explorer"){
[code]....
I've tried various things with the meta tag, including updating multiple parts of the page (using ID|<blah> instead of just a plain echo) and a couple other things. None of them will get the original page itself to reload.
View 9 Replies
View Related
Feb 3, 2006
I'm working on this system, where an admin can manage articles and stuff. The editing, adding and deleting of articles is done from within a Javascript popup. When the new article is added, the admin can hit a "close this window"-link to return to the admin-page, which contains a list of all articles.
This works fine, however, when returning to the list-page, the new article hasn't been added to the list, because there was no page refresh. Is there any way to invoke a page refresh from within the editing-popup?
View 1 Replies
View Related
Mar 10, 2010
I've been searching around for different ways to achieve this.
What I'm trying to do is to add a new DIV to my page without refreshing the actual page, and put that on a timer. Kind of a Live-Blog.[code]...
View 2 Replies
View Related
Jun 6, 2009
I have been searching high and low on how to do this and I think I'm at a loss because I'm so unfamiliar with js and ajax.What I would like to do is have just a single div on a page refresh every 5-10 secs; the content of the div shows what users are logged on; the content is generated by a query on my db
<div id="players"><?php
$online_query = "SELECT user_log.user_id,user_log.ip,user_log.logged_in,user_log.logged_out,users.username,users.type_id FROM user_log LEFT JOIN users ON user_log.user_id=users.id WHERE user_log.logged_in IS NOT NULL AND user_log.logged_out IS NULL ORDER BY users.username";[code]....
almost all of the google results I got for refreshing a div were for updating dropdown boxes or dealt with some kind of page event...so now I'm at a loss on what else to look for..
View 3 Replies
View Related