Search Results

Search found 1381 results on 56 pages for 'reload'.

Page 46/56 | < Previous Page | 42 43 44 45 46 47 48 49 50 51 52 53  | Next Page >

  • jQuery click event on image only fires once

    - by stephenreece@
    I created a view of thumbnails. When the user clicks, I want the real image to pop-up in a dialog. That works the first time, but once the jQuery 'click' fires on an thumbnail it never fires again unless I reload the entire page. I've tried rebinding the click events on the dialog close that that does not help. Here is my code: function LoadGalleryView() { $('img.gallery').each(function(){ BindImage($(this)); }); } function BindImage(image) { var src= image.attr('src'); var id= image.attr('id'); var popurl = src.replace("thumbs/", ""); image.hover(function(){ image.attr('style', 'height: 100%; width: 100%;'); }, function(){ image.removeAttr('style'); }); $('#'+id).live('click', function() { PopUpImage(popurl); }); } function CheckImage(img,html) { if ( img.complete ) { $('#galleryProgress').html(''); var imgwidth = img.width+35; var imgheight = img.height+65; $('<div id="viewImage" title="View"></div>').html(html).dialog( { bgiframe: true, autoOpen: true, modal: true, width: imgwidth, height: imgheight, position: 'center', closeOnEscape: true }); } else { $('#galleryProgress').html('<img src="images/ajax-loader.gif" /><br /><br />'); setTimeout(function(){CheckImage(img,html);},10); } } function PopUpImage(url) { var html = '<img src="'+url+'" />'; var img = new Image(); img.src = url; if ( ! img.complete ) { setTimeout(function(){CheckImage(img,html);},10); } } PopUpImage() only executes the first time an image is clicked and I cannot figure out how to rebind.

    Read the article

  • Login in via curl then open that page logged in

    - by user207022
    I'm trying the following code to send post data to the login form, then reload that page in the browser as a logged in user. somehow it's not saving the cookie, and reusing it for the header() function, can the same thing as header be done by calling curl again after sending the login details? .. $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_FOLLOWLOCATION,true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HEADER, true); curl_setopt($ch, CURLOPT_TIMEOUT, 60); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER , false ); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST , false ); curl_setopt($ch, CURLOPT_USERAGENT, $defined_vars['HTTP_USER_AGENT']); //curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie); curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie); curl_setopt($ch, CURLOPT_MAXREDIRS, 1); // Apply the XML to our curl call curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); $data = curl_exec($ch); setcookie($cookie); header('location: ' . $url); die();

    Read the article

  • JavaScript cookie value can't be retrieved in Django

    - by Boris Rusev
    I am trying to build a web site in both English and Bulgarian using the Django framework. My idea is the user should click on a button, the page will reload and the language will be changed. This is how I am trying to do it: In my html I hava a the button tag <button id='btn' onclick="changeLanguage();" type="button"> ... </button> An excerpt from cookies.js: function changeLanguage() { if (getCookie('language') == 'EN') { document.getElementById('btn').innerHTML = getCookie('language'); setCookie("language", 'BG'); } else { document.getElementById('btn').innerHTML = getCookie('language'); setCookie("language", 'EN'); } } function setCookie(sName, sValue, oExpires, sPath, sDomain, bSecure) { var sCookie = sName + "=" + encodeURIComponent(sValue); if (oExpires) { sCookie += "; expires=" + oExpires.toGMTString(); } if (sPath) { sCookie += "; path=" + sPath; } if (sDomain) { sCookie += "; domain=" + sDomain; } if (bSecure) { sCookie += "; secure"; } document.cookie = sCookie; } And in my views.py file this is the situation @base def index(request): if request.session['language'] == 'EN': return """<b>%s</b>""" % "Home" else request.session['language'] == 'BG': return """<b>%s</b>""" % "??????" So I know that my JS changes the value of the language cookie but I think Django doesn't get that. On the other hand when I set and get the cookie in my Python code again the cookie is set. My question is whether there is a way to make JS and Django work together - JavaScript sets the cookie value and Python only reads it when asked and takes adequate actions? Thank you.

    Read the article

  • select option clears when page loads in php

    - by user79685
    Hey guys, the scenario is this: see select below <form name="limit"> <select name="limiter" onChange="limit(this.value)"> <option selected="selected">&nbsp;</option> <option value="5">5</option> <option value="10">10</option> <option value="15">15</option> </select> </form> I want whenever any option is selected for 3 things to happen: 1.) js limit() function is called which all it does its takes current url, adds new query parameter 'limit' with the user selected value eg: http://localhost/blahblah/apps/category.php?pg=1&catId=3021&limit=5 (this will cause the category.php page to be hit and # of product displayed limited to the value selected by user) 2.)Once the url is hit, it reloads but i DONT want the value selected to reset back to the default (which it currently does). I want it to reflect the users selection after page reload. 3.) Also, when i move to the next page (pagination), i would like the state to be carried ova to the next page (ie. remembering the user selection).

    Read the article

  • Rails 3 Timezone error

    - by Juan
    I am struggling with time zone support in Rails 3 beta and I would like to know if it is a bug or if I am doing something wrong. He is the problem: > Time.zone = 'Madrid' # it is GMT+2 = "Madrid" > c = Comment.new = #<Comment id: nil, title: "", pub_at: nil> > c.pub_at = Time.zone.parse('10:00:00') = Mon, 31 May 2010 10:00:00 CEST +02:00 > c.save > c = #<Comment id: 3, title: "", pub_at: "2010-05-31 08:00:00"> > c.reload = #<Comment id: 3, title: "", pub_at: "2010-05-31 08:00:00"> ruby-1.8.7-p249 c.pub_at = Mon, 31 May 2010 13:00:00 CEST +02:00 As you can see, the pub_at attribute is stored correctly in the database but when it is retrieved it adds 3 hours and I suspect that it is because it is using my local machine timezone that is in GMT-3. The same sequence of commands in rails 2.3.5 works perfectly. Any toughts? Should I report a ticket?

    Read the article

  • Changing property of ItemTemplate controls in ListView

    - by arturito
    I have ListView containig LinkButtons in ItemTemplate. ListView is inside UpdatePanel so it is not doing page refresh. When users click on one the LinkButtons it changes its css property in order to mark the selection: protected void ListView1_ItemCommand1(object sender, ListViewCommandEventArgs e) { ((LinkButton)e.CommandSource).CssClass = "selected"; } That allows multiple selections. But once the page is refreshed the selection disappears, meaning that css property of control goes back to default. <ItemTemplate> <asp:LinkButton ID="local" Text='<%#Eval("Local.Name")%>' runat="server" CommandName="selectLocal" CommandArgument='<%#Eval("Local.Id") %>' CssClass="notSelected" > </asp:LinkButton> <asp:LinkButton ID="guest" Text='<%#Eval("Guest.Name")%>' runat="server" CommandName="selectGuest" CommandArgument='<%#Eval("Guest.Id") %>' CssClass="notSelected" > </asp:LinkButton> </ItemTemplate> How can I select them programatically on page reload? (I'm mainating selection list in session)

    Read the article

  • How do you fix loading plugins in eclipse 3.5.1 on linux?

    - by Jay R.
    I have two linux boxes. Both Fedora 11 x64. On one, I downloaded the eclipse-java-galileo-SR1-linux-gtk-x86_64.tar.gz. I unpacked it to /opt/eclipse-3.5.1/ and used the Install New Software... item to install the SVN team provider and the Polarion SVN connectors. Everything works. On the second, I copied the tar.gar for eclipse there, and then tried to follow the same steps. When I get to the install SVN team provided, eclipse downloads it and claims to install it and asks to restart. I restart and there is no SVN support. The software installer knows its there because I can't reinstall it without uninstalling it. So the questions: Why isn't the plugin/feature loading for the SVN Team Support? Is there a checkbox that I forgot about that enables the plugin? Is there a command line option that will force reload all of the features on the disk? I've tried to install other things like findbugs, but I get the same result. I have no messages in the log file indicating an exception or anything like that.

    Read the article

  • Visual Studio 2010 / ASP.NET MVC 2 / Publish

    - by SevenCentral
    I just did a clean install on Windows 7 x64 Professional with the final release of Visual Studio 2010 Premium. In order to duplicate what I'm experiencing do the following in: Create a new ASP.NET MVC 2 Web Application Right click the project and select Properties On the Web tab, select "Use Local IIS Web Server" Click on Create Virtual Directory Save all Unload the project Edit the project file Change MvcBuildViews to true Save all Reload project Right click the project and select Publish Choose the file system publish method Enter a target location Choose Delete all existing files Select Publish Right click the project Select Publish Each time I do the above I get the following errror: "It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level..." The error originates from obj\debug\package\packagetmp\web.config, relative to the project directory. I can repeat this all day long with any MVC 2 project I've built. In order to fix this problem, I need to set MvcBuildViews to false in the project file. That's not really an option. This wasn't a problem in Visual Studio 2008 and it seems to be an issue with the way the Publish command stages files beneath the project directory. Can anyone else duplicate this error? Is this a bug or by design? Is there a fix, workaround, etc...? Thanks.

    Read the article

  • Modifying CSS class property values on the fly with JavaScript / jQuery

    - by JPN
    all. I've run into a unique situation that I have so far been unable to find a solution for: dynamically assigning a value to a CSS style. I know how to use jQuery to assign width, height, etc. to an element, but what I'm trying to do is actually change the value defined in the stylesheet so that the dynamically-created value can be assigned to multiple elements. What I'm building is a slideshow of images that occupy the full viewport, recalculating the image's width, height, and left properties on resize so that the image is always centered, favors width over height, except when the viewport is taller than it is wide (resizing does not reload the page, just fires a function to resize the image). I have successfully been able to get it to work on one image, and now I'm trying to determine the best way to assign those property values to all images in the slideshow without having to specify those three things individually for every image. Can the values of properties in a class be modified on the fly? I'm sure the answer is out there, I'm probably just not using the correct terminology in my searches. Hope I did a good job of describing the problem. TIA.

    Read the article

  • I'm confused, how do I control cache so my clients can see website edits.

    - by Jared Christensen
    I host about 10 websites for clients. Every so often a client will ask for an update to their website. It may be a simple image change, new PDF or a simple text change. I make the change and then send them a link to the web page with the update. About an hour later I will get an email back from the client telling me they still see the old page. I will then explaining to them how to empty their browsers cache. What I'm trying to figure out is if there is a way I can tell their browser that I made an update to the website and that it should reload the page and update the cache. I thought about trying a meta tag but I read that they are not very reliable. Also I would still like the page to cache I just want to be able to clear it when I make an update. Is this possible? I'm an advanced front end web developer (HTML, CSS, Javascript) and know some PHP. Cache is just one of those things I don't really understand that well.

    Read the article

  • jquery getjson works fine in mac, and fails in windows

    - by viper
    this code loads the data jQuery.ajax({ type: "GET", url: "getOptionsJson.php", cache: false, dataType: "json", data: "config_id="+config_id, success: function(json) { jQuery.extend(dataArr, json.ajax); jQuery.extend(opts, json.ajax2); printResult(config_id); }, error: function() { alert('Error. Please try again'); location.reload(); } }); this code generates it <?php header('Content-type: application/javascript'); echo json_encode(array( "ajax" => array(1 => "test", 2 => "test 2"), "ajax2" => array(1 => "test 3", 2 => "test 4") ); ?> when im working on mac, everything goes fine, but today i tried it on widnows, and it doesnt work. the code flows like its success, but opts and dataArr are null i tried all headers (application/json, text/html, etc) i checked if getOptionsJson.php is called correctly via mail function filnally firebug says that im getting response, but theres no content and file is just 1kb i tried even changing datatype to xml, still fails ie gives a hint, it says 'there's error on site' which reffers to 127 line of jquery file any idea?

    Read the article

  • IE8 removes background-color of header row of Asp:Gridview

    - by Hitesh Riziya
    I am using Asp.net 4.0 GridView control to display data from database. I have applied the inbuilt theme to GridView. <asp:GridView ID="gv" runat="server" CellPadding="4" EmptyDataText="No records found." ForeColor="#333333" OnRowCommand="gv_RowCommand" Width="99%" OnPageIndexChanging="gv_PageIndexChanged" PageSize="50" AllowPaging="True" GridLines="None" AutoGenerateColumns="true"> <AlternatingRowStyle BackColor="White" /> <EditRowStyle BackColor="#7C6F57" /> <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" /> <HeaderStyle CssClass="GridHeader" BackColor="#1C5E55" Font-Bold="True" ForeColor="White" HorizontalAlign="Left" /> <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" /> <RowStyle BackColor="#E3EAEB" /> <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" /> <SortedAscendingCellStyle BackColor="#F8FAFA" /> <SortedAscendingHeaderStyle BackColor="#246B61" /> <SortedDescendingCellStyle BackColor="#D4DFE1" /> <SortedDescendingHeaderStyle BackColor="#15524A" /></asp:GridView> I tried setting the CSS forcefully in my Master page .GridHeader { background-color:#1C5E55 !important;} But I am still missing the background-color. I can see the backgroundcolor applied to grid (for less-than 1 sec) while the page loading the js/css content NOTE: I already tried clearing cache of IE, ctrl + F5, shift + reload etc. Here is sample page of my issue. http://vd2.weenggs.com/Items.aspx email: [email protected] pass: test Thanks

    Read the article

  • android httpurlconnection [closed]

    - by user620451
    hi im new android developer i am trying to login to my asterisk server passing my username and password it works good but when i am trying to request anther url to the server after login i get access denied and i now the problem because the login connection has disconnected so i want a way to request to urls the first one is login to the server and the second is to do something else after login please help and thx anyway this is a part of my code i want to request this 2 url url1="http://192.168.1.7:8088/rawman?action=login&username=admin&secret=admin" url2="http://192.168.1.5:8088/rawman?action=updateconfig&reload=yes&srcfilename=users.conf&dstfilename=users.conf&Action-000000=newcat&Cat-000000=6001&Var-000000=&Value-000000=" public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); tv1 = (TextView) this.findViewById(R.id.display); ed1 = (EditText) this.findViewById(R.id.editText); bt1 = (Button) this.findViewById(R.id.submit); bt1.setOnClickListener(new OnClickListener() { public void onClick(View view) { { try{ ServerRequest(url1); ServerRequest(url2); } catch(Exception e) { Log.v("Exception", "Exception:"+e.getMessage()); } } } }); } public String ServerRequest(String serverString) throws MalformedURLException, IOException { String newFeed=serverString; StringBuilder response = new StringBuilder(); Log.v("server","server url:"+newFeed); URL url = new URL(newFeed); HttpURLConnection httpconn = (HttpURLConnection) url.openConnection(); if(httpconn.getResponseCode()==HttpURLConnection.HTTP_OK) { BufferedReader input = new BufferedReader( new InputStreamReader(httpconn.getInputStream()), 8192); String strLine = null; while ((strLine = input.readLine()) != null) { response.append(strLine); } input.close(); } tv1.settext(response); return response.toString(); }

    Read the article

  • "reset" cells after changing orientation

    - by Christian
    Hi, I added the interfaceOrientation to my app. It works fine concerning the views. Some of the table-cells I defined by CGRects to position the text in the cell. In portrait-mode the cell is 300px long, in landscape-mode 420px. I use the following code to change the CGRects depending the orientation: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { if (self.interfaceOrientation == UIDeviceOrientationPortrait) { NSString *currentLanguage = [[NSString alloc] initWithContentsOfFile:[NSHomeDirectory() stringByAppendingPathComponent:@"/Documents/sprache.txt"]]; static NSString *TableViewTableCellIdentifier = @"TableViewTableCellIdentifier"; UITableViewCell *cell = (UITableViewCell *) [tableView dequeueReusableCellWithIdentifier:TableViewTableCellIdentifier]; CGRect cellRect = CGRectMake(0, 0, 300, 175); cell.backgroundColor = [UIColor darkGrayColor]; cell = [[[UITableViewCell alloc] initWithFrame:cellRect reuseIdentifier:TableViewTableCellIdentifier] autorelease]; CGRect keyLabelRect = CGRectMake(0, 5, 5, 20); UILabel *keyLabel = [[UILabel alloc]initWithFrame:keyLabelRect]; keyLabel.tag = 100;......... } else { NSString *currentLanguage = [[NSString alloc] initWithContentsOfFile:[NSHomeDirectory() stringByAppendingPathComponent:@"/Documents/sprache.txt"]]; static NSString *TableViewTableCellIdentifier = @"TableViewTableCellIdentifier"; UITableViewCell *cell = (UITableViewCell *) [tableView dequeueReusableCellWithIdentifier:TableViewTableCellIdentifier]; CGRect cellRect = CGRectMake(0, 0, 450, 175); cell.backgroundColor = [UIColor darkGrayColor]; cell = [[[UITableViewCell alloc] initWithFrame:cellRect reuseIdentifier:TableViewTableCellIdentifier] autorelease]; CGRect keyLabelRect = CGRectMake(0, 5, 5, 20); UILabel *keyLabel = [[UILabel alloc]..... My problem is, when the table is visible and the orientation is changed, I need to scroll to see the new "layout". How can I manage to "reload" the view after changing the orientation?

    Read the article

  • Python 3, urllib ... Reset Connection Possible?

    - by Rhys
    In the larger scale of my program the goal of the below code is to filter out all dynamic html in a web-page source code code snippet: try: deepreq3 = urllib.request.Request(deepurl3) deepreq3.add_header("User-Agent","etc......") deepdata3 = urllib.request.urlopen(deepurl3).read().decode("utf8", 'ignore') The following code is looped 3 times in order to identify whether the target web-page is Dynamic (source code is changed at intervals) or not. If the page IS dynamic, the above code loops another 15 times and attempts to filter out the dynamic content. QUESTION: While this filtering method works 80% of the time, some pages will reload ALL 15 times and STILL contain dynamic code. HOWEVER. If I manually close down the Python Shell and re-execute my program, the dynamic html that my 'refresh-page method' could not shake off is no longer there ... it's been replaced with new dynamic html that my 'refresh-page method' cannot shake off. So I need to know, what is going on here? How is re-running my program causing the dynamic content of a page to change. AND, is there any way, any 'reset connection' command I can use to recreate this ... without manually restarting my app. Thanks for your response.

    Read the article

  • What's the most efficient way to load data from a file to a collection on-demand?

    - by Dan
    I'm working on a java project that will allows users to parse multiple files with potentially thousands of lines. The information parsed will be stored in different objects, which then will be added to a collection. Since the GUI won't require to load ALL these objects at once and keep them in memory, I'm looking for an efficient way to load/unload data from files, so that data is only loaded into the collection when a user requests it. I'm just evaluation options right now. I've also thought of the case where, after loading a subset of the data into the collection, and presenting it on the GUI, the best way to reload the previously observed data. Re-run the parser/Populate collection/Populate GUI? or probably find a way to keep the collection into memory, or serialize/deserialize the collection itself? I know that loading/unloading subsets of data can get tricky if some sort of data filtering is performed. Let's say that I filter on ID, so my new subset will contain data from two previous analyzed subsets. This would be no problem is I keep a master copy of the whole data in memory. I've read that google-collections are good and efficient when handling big amounts of data, and offer methods that simplify lots of things so this might offer an alternative to allow me to keep the collection in memory. This is just general talking. The question on what collection to use is a separate and complex thing. Do you know what's the general recommendation on this type of task? I'd like to hear what you've done with similar scenarios. I can provide more specifics if needed.

    Read the article

  • HTML dynamic tags insert looks different compared to static layout

    - by Andrew Florko
    I program HTML interface with jquery. There is editable list of publications on the page and user can click any publication to edit details. Popup window appears with data and there is list of authors embedded into details form. There are edit/delete buttons against every of them + "add new author" button. User manipulates authors without page reload. When I insert a new author there are new edit/delete buttons created dynamically & embedded into page. I insert tags like this: <td class="author-actions"> <img onclick='edit(id)' .../> <img onclick='delete(id)' .../> </td> Just the same html-layout that is sent from web-server when popup window appears. But somehow it looks different. There is extraspace between images though firebug demonstrates the same css attributes applied. If I select with mouse inserted layout with IE, somehow it can reorder and become the same-looklike as the those, send by web-server. What can it be?

    Read the article

  • WPF tree data binding model & repository

    - by Am
    Hi, I have a well defined tree repository. Where I can rename items, move them up, down, etc. Add new and delete. The data is stored in a table as follows: Index Parent Label Left Right 1 0 root 1 14 2 1 food 2 7 3 2 cake 3 4 4 2 pie 5 6 5 1 flowers 8 13 6 5 roses 9 10 7 5 violets 11 12 Representing the following tree: (1) root (14) (2) food (7) (8) flowers (13) (3) cake (4) (5) pie (6) (9) roeses (10) (11) violets (12) or root food cake pie flowers roses violets Now, my problem is how to represent this in a bindable way, so that a TreeView can handle all the possible data changes? Renaming is easy, all I need is to make the label an updatble field. But what if a user moves flowers above food? I can make the relevant data changes, but they cause a complete data change to all other items in the tree. And all the examples I found of bindable hierarchies are good for non static trees.. So my current (and bad) solution is to reload the displayed tree after relocation change. Any direction will be good. Thanks

    Read the article

  • Issue scrolling table view with content inset

    - by Rog
    Hi all, I am experiencing a weird scrolling issue and I was hoping someone could give me a hand in trying to identify why this is happening. I have included the part of my code that I think is relevant to the question but am happy to update this post with whatever else is needed. I have implemented a pull to refresh view in the tableview's content inset area. The refresh fires an Async NSURLConnection that pulls data from a webserver, parses the relevant information and refreshes the table as required. This is where the refresh process kicks off: - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate{ if (scrollView.contentOffset.y <= - 65.0f && !self.reloading) { self.reloading = YES; [self reloadTableViewDataSource]; [refreshHeaderView setState:EGOOPullRefreshLoading]; [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:0.2]; self.tableView.contentInset = UIEdgeInsetsMake(60.0f, 0.0f, 0.0f, 0.0f); [UIView commitAnimations]; } } Problem is if I start to scroll whilst the content inset is "visible" (i.e. during reload) I get this weird behaviour where my table sections do not scroll all the way to the top - see screenshot for a clear visual of what I am trying to describe here. I have included a couple of screenshots below that clearly identify what is happening at the moment. Has anyone experienced this before? Any ideas on what I should be looking at to try and fix it? Many thanks in advance, Rog And this is the result if I start scrolling the table. The orange bit at the top of the image is the actual navigation bar, where I would expect the table section (date 1 December 2010) to be.

    Read the article

  • jQuery $.ajax calls success handler when reuqest fails because of browser reloading

    - by Martin
    I have the following code: $.ajax({ type: "POST", url: url, data: sendable, dataType: "json", success: function(data) { if(customprocessfunc) customprocessfunc(data); }, error: function(XMLHttpRequest, textStatus, errorThrown){ // error handler here } }); I have a timer which makes AJAX requests often. If I do not receive anything in 'data', I show an error message to the user - it means, something wnet bad on the server. The problem is when user reloads the page while the AJAX call is in progress. I can see in the firebug that the AJAX call fails (URL is colored red and no HTTP status is displayed) so I expect that jQuery will stop the reuqest or at least go to the error handler. But it goes to the success handler and passes null in the 'data' variable. As a result, when user reloads the page, sometimes he can see my big red message about unknown error (because data is null). Is there any way to make jQuery abort the request on complete reloading all at least not to call my success function? I have no way to know in the success handler why the data is null - did it came empty from the server or the call was aborted because of reload.

    Read the article

  • Safari and Chrome back button changes hidden and submit values in forms

    - by OverClocked
    The following problem happens on both Safari and Chrome, so probably a WebKit issue. Page A: a page that requires you to login to see, contains a form that has a type=submit button, with name=submit, and value=a Page B: some other page Page C: ask user to login page, contains a form with a type=submit button, with name=submit and value=c User visits page A, then page B. Then idles and the user's login session times out. User hits back button to go back to page A. Browser redirects user to page C. On Safari and Chrome, when C is rendered, the form on page C has the type=submit button, name=submit, but value shows up as "a". If you reload while on page C, "c" appears as the value of the name=submit button. The same problem appears with type=hidden input fields; when user hits back button, their values are also changed to some other value from some other form. Also, this problem also shows up w/o the redirect, with just submit then back. In this case the previous page renders with incorrect values for hidden and submit CGI variables. So far the only fix I can come up with is use Javascript to reset the type=hidden and type=submit variable values, after page C loads, to make sure the values are correct. But that's not clean and universally applicable. Short of WebKit fixing this error, has anyone ran into a better workaround? Thanks.

    Read the article

  • Website. VoteUp or VoteDown Videos. How to restrict users voting multiple times?

    - by DJDonaL3000
    Im working on a website (html,css,javascript, ajax, php,mysql), and I want to restrict the number of times a particular user votes for a particular video. Its similar to the YouTube system where you can voteUp or voteDown a particular video. Each vote involves adding a row to the video.votes table, which logs the time, vote direction(up or down), the client IPaddress( using PHP: $ip = $_SERVER['REMOTE_ADDR']; ), and of course the ID of the video in question. Adding votes is as simple as; (pseudocode): Javascript:onClick( vote( a,b,c,d ) ), which passes variables to PHP insertion script via ajax, and finally we replace the voteing buttons with a "Thank You For Voting" message. THE PROBLEM: If you reload/refresh the page after voting, you can vote again, and again, and again, you get the point. MY QUESTION: How do you limit the amount of times a particular user votes for a particular video?? MY THOUGHTS: Do you use cookies, and add a new cookie with the id of the video. And check for a cookie before you insert a new vote.? OR Before you insert the vote, do you use the IPaddress and the videoID to see if this same user(IP) has voted for this same video(vidID) in the past 24hrs(mktime), and either allow or dissallow the voteInsertion based on this query? OR Do you just not care? Take the assumption that most users are sane, and have better things to do than refresh pages and vote repeatedly.?? Any suggestions or ideas welcome.

    Read the article

  • How to implement a log window in a web browser?

    - by Jeremy Friesner
    Hi all, I'm interested in adding an HTML/web-browser based "log window" to my net-enabled device. Specifically, my device has a customized web server and an event log, and I'd like to be able to leave a web browser window open to e.g. http://my.devices.ip.address/system_log and have events show up as text in the web browser window as they happen. People could then use this as a quick way to monitor what the system is doing, without needing run any special software. My question is, what is the best way to implement this? I've tried the obvious approach -- just have my device's embedded web server hold the HTTP/TCP connection open indefinitely, and write the necessary text to the TCP socket when an event occurs -- but the problem with that is that most web browsers (e.g. Safari) don't display the web page until the server has closed the TCP connection has been closed, and so the result is that the log data never appears in the web browser, it just acts as if the page is taking forever to load. Is there some trick to make this work? I could implement it as a Java applet, but I'd much prefer something more lightweight/simple, either using only HTML or possibly HTML+JavaScript. Also I'd like to avoid having the web browser 'poll' the server, since that would either introduce too much latency (if the reload delay was large) or put load on the system (if the delay was small)

    Read the article

  • Kohana 3, problem with m2m data adding

    - by Marek
    Hello I posted this on official forum but with no result. I am getting :Undefined index: enrollment error when trying to save data. My pivot model: class Model_Enrollment extends ORM { protected $_belongs_to = array('page' => array(), 'menugroup' => array()); } Model_Page protected $_has_many = array('templates' => array(), 'menugroups' => array('through' => 'enrollment')); Model_Menugroup protected $_has_many = array('menuitems' => array(), 'pages' => array('through' => 'enrollment')); //Overriden save() method in Model_Menugroup: public function save() { if (empty($this->created)) { $this->created = time(); } parent::save(); $this->reload(); if (! $this->is_global) { if (! empty($this->groupOwnerPagesId) { $page = ORM::factory('page'); foreach($this->groupOwnerPagesId as $id) { $this->add('enrollment', $page->find($id)); } } } } I did: I corrected table names in pivot model by changing them to singular I even now using the same name for pivot table / model = enrollment. The same as in tutorial. Just in case So the pivot table has name 'enrollment' and has 2 columns: page_id , menugroup_id I tried to add pk in pivot table, but it changed nothing I tried to add/remove db relation between pages/menugroups and pivot table (InnoDB) but with no luck I tried save all data in controller, but with the same bad result:( I am still getting the same error: Undefined index: enrollment in ORM line: $columns = array($this-_has_many[$alias]['foreign_key'], $this-_has_many[$alias]['far_key']); Could somebody tell me, what can be else wrong? I have no other ideas:( Kind regards

    Read the article

  • echo php javascript alert?

    - by Anaes Arias
    How can I echo this javascript if the php error messages is called? I have an error message setting that when a user misses his username or password it triggers an error message. The php error message is called by a php code. Here is the code: <?php echo showmessage($msg) ?> I have an alert message in javascript that when called it will make a javascript css pop up alert box. IF the javascript code is present it will show the alert box right away after reload. Here is code: <script type="text/javascript"> $(document).ready(function () { jqxAlert.alert('Alert Message'); }) </script> How can I incorporate so that when the php echo message comes up it will trigger the javscript alert message. I was trying an if in php, so something like this code: if ( showmessage($msg) ) { <script type="text/javascript"> $(document).ready(function () { jqxAlert.alert('Alert Message'); }) </script> } How can I echo my javascript message on the php call?

    Read the article

< Previous Page | 42 43 44 45 46 47 48 49 50 51 52 53  | Next Page >