SEARCH YOUR SOLUTION HERE  

refresh page after ajax request and after client-side removal of DOM element - JavaScript Help

How can i reload the page in this jquery function

$(document).ready(function(){ $('table td a.delete3').click(function(){ var del_id = $(this).parent().attr('id'); var info = 'del_option_id=' + del_id; if(confirm("Zeker dat je deze optie met id " + del_id + " wilt verwijderen")){ $.ajax({ type: "POST", url: "deleteActies.php", data: info, success: function(){ } }); $(this).parent().remove(); } return false; }); });
First the ajax call should be finished, then the element (an option belonging to a question) should be removed --> $(this).parent().remove() and then the page should be reloaded.



Posted On: Tuesday 27th of November 2012 08:41:15 PM Total Views:  171
View Complete with Replies




Related Messages:

Updating the PHP information without refreshing the?   (112 Views)
Can someone help me with writing the script to be able to pull the information from the database without refreshing everytime something new has been added My codes at the moment read: $recentupdates = mysql_query("SELECT * FROM status NATURAL JOIN users WHERE user_id = users.id ORDER BY status_id DESC LIMIT 0, 5"); $recentnumrows = mysql_num_rows($recentupdates); //Creating While Loop to place all information here while ($recentrow = mysql_fetch_assoc($recentupdates)) { //Adding the Profile picture echo ''.$recentrow['date'].''; echo ''; echo ''.$recentrow['fname'].' '.$recentrow['lname'].' said: '; echo ''.$recentrow['status'].''; //Line Break between each post. if ($recentnumrows > 1) { echo ''; echo ''; } } the codes works of course. But I want it to be updated automatically when a new post has been made.
Making a search engine without refreshing   (86 Views)
, I have a search engine that I've created. It searches my MySQL database, but I was wondering how do you make it so it won't refresh the page This is my form.php Search Location
refresh content of .txt file in webpage?   (98 Views)
, i am trying to have the content of a txt file loaded in a page (which works), but this file changes on a regular basis and I need just the text to refreash, not the whole page, this is what I have... As mentioned, it correctly displayes the content of the .txt file, but from the code I have, I need it to refresh, any help would be greatly appreciated. Thank you in advance. P.S. Only seems to work in IE at the moment, any advice on how to get it to work in FF would be greatly appreciated (in FF it just doesnt display the ocntent of the .txt file)
display different video on refresh   (83 Views)
Hi I'm building a video site for the radio station I work for and need to display a specified video on each refresh. The video will be an embed from youtube and sit in a of it's own. Unfortunately due to the servers I work on I can't user server side programming. To give you an idea of how it looks (it might help) the sites on test at http://vikingfm.bauerweb.co.uk/vfmtv-test/index.html .
DHTML widget/guestbook problems with refresh   (104 Views)
site with issue: http://pjrey.com/guestbook ok, ive tried and tried, no luck. what i am trying to do is: 1) the modal dhtml sign/window auto load (but only one time per user) 2) on completing the form, and hitting submit, i want the parent window refreshed (to show new content that was just added)... i have just been trying to get the parent window to refresh.. spent hours... i seem to have got it to, but it is as if it is reloading before the form is processed, the only way to get the form contents to show up that were just entered, is to reload the page manually... so, how do i have the page reload after form completion (hitting submit) and last, (point number 1) is it possible for the SIGN window to auto load, but only once (because if the parent window is refreshing during form submit, then the sign modal window will re-appear, correct i hope this makes sense.. thanks for your time (these little dumb problems just gnaw away at me) i have it loading an iframe (i tried ajax, but my repatcha wasnt showing) thanks a bunch! pj
Need to load xml, xslt and refresh every 5 seconds   (91 Views)
Ok I have the following XML file: xcxvxc False 1 43534534534535 SUPER 34 BUL #003366 #CCCCCC 10 CHF #CCCCCC #CC9933 10. STEYN PEN-1/1 CON-3/3 DG-1/1 9. du PREEZ 2 11. HABANA 1 1. STEENKAMP 1 10. DONALD PEN-1/1 CON-1/1 DG-0/0 14. MASAGA 1 - 0 - 0 1 1 0 0 1 1 1 0 0 0 1 0 36 64 5 5 4 1 1 1 3 4 3 12 1 1 1 4 2 1 3 0 4 1 5 4 2 0 16 21 44 59 5 5 5 1 41 39 3 4 54 46 3 3 0 0 34 33 5 5 and the following XSLT: KIDS sportinfo test Territory TIME TIME Possession CURRENT PHASE Mins in Possession Lineouts Mins in Opp 22 Penalties Conceded - Turnovers Conceded - Breakdowns - BD Turnovers Won Against Throw Handling Errors Not Straight Missed Tackles Line breaks - Intercepts - Scrums Won - Pick and Go Against Throw Not Straight What I need to do is display the data on the web and refresh the data every 5 seconds. I am not aloud to use things like jquery as this site will be used via analogue modem sometimes. So my question is how do I do it Also I can not assign the xsl inside the xml and the same source will be viewed elsewhere
Ajax Chained Select Boxes Are Not refreshing   (79 Views)
Ok so i have created a Javascript/PHP/Ajax application. I have a sequence of 6 select boxes. The first is hardcoded in HTML. When you change the selection it sends a variable via Ajax to PHP which uses the variable to query the database. When the second box changes it then sends the 2 variables from the previous select boxes. Each time a select box is changes it adds another variable to send. In the end there is a total of 5 or 6 variables which is all good, everything is functioning well and almost doing what i want it to do. My problems occur with select boxes 3 and 6. Initially they work fine. But when you go back to change select box 2, number 3 does not refresh. The values stay the same as before. The same with number 6, when i change number 3, box 4 changes and in sequence box 5 changes, however box 6 remains the same as the previous query. Ajax code used is identical with just variable names and relevant Elements changed. Can anybody help i will post the link to the application and the ajax code in question. Just so you know only select box 1 is visible initially, the rest are generated by php/ajax onchange. Heres the code in question // Get the HTTP Object // Get the HTTP Object function getHTTPObjectNet(){ if (window.ActiveXObject) return new ActiveXObject("Microsoft.XMLHTTP"); else if (window.XMLHttpRequest) return new XMLHttpRequest(); else { alert("Your browser does not support AJAX."); return null; } } // Implement business logic function networkSelector(){ var selectBox2 = document.getElementById("SelectManufacturer"); // get HTML select box by id var selectModel = document.getElementById("modelSelector"); httpObject2 = getHTTPObjectNet(); if (httpObject2 != null) { httpObject2.open("GET", "http://somesite.co.uk/NetworkAjax.phpinputText2=" +selectBox2.options[selectBox2.selectedIndex].text +"&modelText2="+selectModel.options[selectModel.selectedIndex].text , true); httpObject2.send(null); httpObject2.onreadystatechange = setOutput2; } } // Change the value of the outputText field function setOutput2(){ if(httpObject2.readyState == 4){ document.getElementById("networkSelect").innerHTML = httpObject2.responseText; } } var httpObject2 = null; Here is the link to the application http://4udev.refixstudios.co.uk/csv-test/ The best way to test is buy selecting any manufacturer and model then network, after that select Apple---The New Ipad 4G, this is how you notice that it does not change. This selection should only bring back Orange as network And Heres the PHP that it calls
jquery mobile refresh help   (248 Views)
, I am having trouble with getting jquery mobile not cache pages on the device. Does anyone know of a way to do this, I am COMPLETELY lost.
Page refresh when MySQL db changes   (100 Views)
I have heard that AJAX is a way to get a page to refresh when a MySQL db has changed. Basically we have a log (that several users at a time could be looking at), when data is submitted it posts to the MySQL db. Instead of having the page auto-refresh every 2 minutes or so, it would be nice if it would just refresh when a change is detected in the db. This would also cut down on the chances that data is missed due to inopportune refreshing/submitting. Pretty much a novice so any help on where to start would be appreciated. DS, When an AJAX request is complete, the connection between the script and the server is closed. The communication dynamics is just like that between the browser and the server. Once the connection is closed, the server does not know who just asked for whatever resource, so it cannot notify any of its clients of new changes. You would need to do it as you are currently doing, polling/checking periodically for changes to the db. On another note, the funtionality that you are looking for I have seen it but with applets on the client side and Tomcat web server on the back end. Not sure if you want to pursue that, but that would be the way to go. Basically you would be creating a "Chat application" where the users only get to chat with your application (as opposed to other users). When the user chats, the server application receives the message and saves it to the db. As soon as the data is saved, the server sends a "chat message" to all the users. Instead of saying "You have new data. Refresh Now", the server would just "push" the updated info to the clients. The client application would "erase" the old data and update with the new data.
Iframe issue must refresh   (121 Views)
I have an issue with my iframe, that contains pages of my online shop. When using paypal, having added a product to the cart and on the paypal page, you click. continue shopping, you are returned to the shop but other 'add to cart buttons' are non functional unless the iframe is first refreshed. Can anyone please help Page containing iframe, please test http://www.camosreptiles.com.au
Dynamic iFrame height, not working in ie without refresh.   (302 Views)
When i try to dynamically change the height of an iframe in ie through a java-script to match its content (a html page containing a flash movie), it doesn't resize the iframe at first, but when i reload the same page into the iFrame it resizes as planned, how come Any ideas This script works well in firefox, safari and netscape, but i cant get it to work in ie(8, 7). And i get the same problems with every resizing script i've tried. This is the script i use: The iframes: IFRAME> I have a flash menu in the first iframe, the buttons on the menu uses getURL(siteToLoad, "contents") to load another html-page into the iframe "contents". Is it possible to make the iFrame refresh automatically though javascript so that i just refreshes the iframe once Everytime ive tried that it just ends up in a never ending refresh-loop... How can i make this work Is there any better script for resizing (and refreshing after resize) the iframe height so that it matches to its content Please, i've been stuck with this problem for some days now... // Max
Retain multiple checkbox selection upon refresh or?   (116 Views)
Can we retain multiple checkbox selection upon refresh or using pagination for few hundred records There is a page where user sees all the items which has search box on the field column to perform searches and select items using checkbox besides those items. While searching the items page result changes and previous selected value is lost. Also the selection is lost when I use the pagination link below the result. Any Solution
window refresh issue   (209 Views)
background: I have a computer with 2 monitors. One monitor opens a web page to an inventory manager(M1). The other monitor has a web page with a display of available inventory(M2). When I update something on M1 and the page reloads I want it to automatically refresh M2. Currently I just have a timer running on M2 that refreshes the page every 60 seconds. It would be better if it only refreshed when needed. The base code is all in PHP. The web page that opens for M2 I'm just using a target="inv". I've tried a bunch of variations of javascript but can't get M2 to refresh when M1 reloads. I was thinking the easier way to do this would be: 1. Check to see if the M2 window is open. I can open it with the same name every time. 2. If the M2 window is open make it redirect to show.php I just don't know javascript enough to do this.
No tab/page refresh when internet options internet?   (107 Views)
Hi Experts here, Pls help. first I set the following in IE6 :Under Tools/Internet Options... 1) Temporary Internet file [Settings...] 2) Check for newer versions of stored pages 3) "Never" option is selected Double click a category to change the current one; tab category stays the same.No tab/page refresh when internet options under temp internet settings are set to never retrieve new stored pages. please help me How to do that should work properly .
image change on refresh   (208 Views)
Hi , I have seen a lot of examples of what I am after online, however nothing is quite what I need. What I am attempting to do makes things a little more complex. Within a div, I have quite a few images displayed (I am only showing a couple). Now to try and explain the above. When my page is loaded, the first a displays 1.jpg and the second a displays 2.jpg. 1tab.jpg and 2tab.jpg are set to display:none. When the page is resized, css in my media query sets 1.jpg and 2.jpg to display none, and 1tab.jpg and 2tab.jpg to display block. So basically only 1 image is ever displayed within an a at any one time, the image depends on the size of the browser. Now for the fun part. What I am attempting to do is change the images with javascript everytime the page is refreshed. I wont bother about the tab images for now, I showed these to demonstrate what I am doing, incase it has a bearing on what I need to do. Ok, so now I display 1.jpg and 2.jpg. When the page is refreshed, I need it to display 2 new images 3.jpg and 4.jpg. When the page is refreshed again, it will go back to 1 and 2 and so forth. Is something like this possible As I say, I have seen some examples, but they all seem to display random images in one location. I know what images I want displayed, and I have several places I want to display them. Cheers
Javascript: Changing text color in span tags after refresh   (76 Views)
Hi: How can I change the text color in a span tag after a refresh This is what I have done so far: var colors = new Array(); colors[0]="red"; colors[1]="orange"; colors[2]="blue"; colors[3]="green"; colors[4]="purple"; colors[5]="pink"; colors[6]="brown"; var colors = Math.floor(Math.random()*7); I'm just stuck on what I should do next
Dropdown submit without refresh   (101 Views)
So my code is simple html, I need it to select value when submit and if value= that number, submits something like: "Your number is 1"(without refreshing the page).
Help, Table row/cell refresh image when clicked (referring?   (165 Views)
I've been reading and trying to figure out a way for half a day yesterday, and any solutions seems to fit to this. Overview: My solution is building up xml files from different folders on another server. After the xml is built up, I can run a "File Mapping" which will grab the appropriate information from the a specific xml selected with a dropdown and pass it to the asp:repeater. The binding is done on load, reading all the xml elements and passing it to a collection of object that will be bound to the repeater ( results.DataSource = listOfObjects; results.DataBind(); ) Now here is the problem. In each row of the table there is columns containing static informations and the last cell of the row is an img button that represent a gray checkmark and that on click should change to green. However, onclick now I only change the data to the xml, and on next "File map" it'll be there. I cannot simply refresh the page, because it takes a fairly long amount of time to refresh because most of the times there is over 350 records to load and above that, you cannot simply refresh page because the page is call through ajax and a refresh will bring you back to the default.aspx. I've already built a function to get the param back through jQuery, however I really have no clue how to bind it to the image. Current line with image: IsQAComplete being the bool used used for checkmark which is referring to the listObject.
AJAX page refresh help ?   (97 Views)
I want to make my current song playing update with AJAX on my page every time that the song name changes I can get the variable to post in the page but currently use a meta-refresh based on time of file or every 30 sdeconds ... what I would like to do is have ajax do this without a meta refresh can this be done Anyone I would be most greatful
Data persistence and refresh   (50 Views)
I have a piece of elearning where users move from screen to screen. The content itself is displayed within an IFRAME with the parent window containing the various navigation controls and javascript. I did it this way because there's a ...