Search Results

Search found 209 results on 9 pages for 'prepend'.

Page 4/9 | < Previous Page | 1 2 3 4 5 6 7 8 9  | Next Page >

  • my jquery code dont work?

    - by kingdom
    UCCN1003Edit <script type="text/javascript"> $(function(){ $('a.edit').click(function(event){ var change = $(this).parent('div').find('p'); var changeText = change.text(); var wrapper = $(this).parent('div'); var clone = change.clone(true); var changeBox = $(this).parent('div').find('.editBox'); var changeBoxText = changeBox.val(); if($(this).text() == 'Edit'){ wrapper.prepend("<input class='editBox' type='text' value='"+ changeText + "'/>"); wrapper.append("<a href='#' class='save' style='margin-left:10px' >Save</a>"); change.remove(); $(this).text("cancel"); }else if($(this).text()=='cancel'){ wrapper.prepend("<p>" + changeBoxText +"</p>"); $('.editBox').remove(); $('.save').remove(); $(this).text('Edit'); } }); $('.save').click(function(event){ var editBox = $(this).parent('div').find('.editBox'); var editBoxText = editBox.text(); var wrapper = $(this).parent('div'); wrapper.prepand("<p>" + editBoxText + "</p>"); editBox.remove(); $(this).remove(); }); }); </script> My part that work work is $('.save').click(function(event){ var editBox = $(this).parent('div').find('.editBox'); var editBoxText = editBox.text(); var wrapper = $(this).parent('div'); wrapper.prepand("<p>" + editBoxText + "</p>"); editBox.remove(); $(this).remove(); }); where the wrapper wont prepand the p tag and the editBox and the .save wont be remove. i try to add alert("work") in this and it wont alert at all. anyone know why?

    Read the article

  • Relocating html elements with jquery

    - by Steven
    Could someone help me with this code? I'm trying to rearrange figures in a certain div into two columns (a and b) in such a way the two columns are about the same height. I've got insane trying to find the problem in my code and not finding it. It doesn't work for a reason... <body onload="rearrangeImages();"> <div class="images"> <figure> <figcaption>This is the figcaption of this figure. An image is missing for this test.</figcaption> </figure> <figure> <figcaption>This is the figcaption of this figure.</figcaption> </figure> <figure> <figcaption>Another one.</figcaption> </figure> </div> <script> function rearrangeImages() { $('.images').each(function() { $(this).prepend('<div class="column_b"></div>'); $(this).prepend('<div class="column_a"></div>'); $(this).append('<div class="test_div"></div>'); $('figure', this).each(function() { var height_a = $(this).parent().$(".column_a").height(); var height_b = $(this).parent().$(".column_b").height(); if (height_a > height_b) { $(this).parent().$(".column_b").append(this); } else { $(this).parent().$(".column_a").append(this); } $(this).remove(); }); }); } </script> </body> Next I would like to be able to make the last figure not going in any of the columns in case it would make column_b higher than column_a. (pseudocode) if (this is last figure) { //place last figure in test_div to measure its height; if (height_a > height_b + height_of_last_image) { $(this).parent().$(".column_b").append(this); } else { $(this).parent().append(this); } } else { //do the normal stuff see higher }

    Read the article

  • C++ write to front of file

    - by user231536
    I need to open a file as ofstream and write to the front of the file, while preserving the remaining contents of the file, which will be "moved". Similar to "prepend" a file. Is this possible using the STL or boost ?

    Read the article

  • Unable to execute functions on elements loaded with AJAX (jQuery)

    - by Jason
    i am using .prepend() to load data after i POST a form with .ajax(). once the new elements are added, my functions won't work on them. if i link the js file directly in the prepended data, the functions work, but when i POST, i starts multiplying the events. i have a feeling it has something to do with binding, but i am not able to figure out exactly how to handle it. any ideas? thanks!

    Read the article

  • apache mod_rewrite

    - by eduard-schnittlauch
    Hi, I want mod_rewrite to do this: http://server/* - redirect to http://server/app/* http://server/app/* should not be redirected http://server.domain/* - redirect to http://server/app/* http://server.domain/app* - redirect to http://server/app/* It has to work with mod_jk! Edit: this is the final solution ` force use of host 'server' RewriteCond %{HTTP_HOST} !^server$ RewriteRule ^(.*)$ server$1 [R,NE,L] ` prepend /app to URL if missing RewriteCond %{request_uri} !^/app.*? RewriteRule ^(.+?)$ app/$1 [R,NE,L] Thanks to you, fahadsadah and Insanity5902! I'm hesitant to flag either one of you as 'correct', as both have provided valuable input that made up the final solution.

    Read the article

  • Vim: :silent with makeprg

    - by ash
    I use pylint on .py files for :make in my .vimrc, although any program, pylint or otherwise, applies to this problem. set makeprg=pylint\ --reports=n\ --output-format=parseable\ % When I run :make, I inevitably get the annoying Press ENTER or type command to continue prompt. I know this can be disabled with :silent, but I can't prepend it to the makeprg variable like this, because it throws an error: set makeprg=:silent "pylint\ --reports=n\ --output-format=parseable\ %" If I try to have my own "Silent make command," command Smake silent make The screen goes black after calling it. How would I do it?

    Read the article

  • merge pieces of file together

    - by veilig
    I have a directory tree of files I need to loop through and reformat the lines. can I do this with sed with some combination of find? for each file, I'll need to adjust the text in the file from ... * @category Foo * @package Bar ... into just this (Remove the @category line, but prepend the value to the package annotation value) ... * @package Foo/Bar ... what is the most efficient way of doing this? its a few hundred files that will be modified.

    Read the article

  • Display Call To Action bar on page load [migrated]

    - by dasickle
    I am using the following code to load the bar on click but I can't figure our how to load it on page load automatically. <script> var autohide; $('body').prepend('<div id="bn-bar"><b>DON\'T MISS OUT!</b> Only 9 seats remain for the Google Tag Manager training on May 22! <a href="#">Book Your Seat Today!</a><div id="hider"> </div></div>'); $(document).ready(function(){ $("#hider").click(function(){ $("#bn-bar").animate({ top: "-50" }, "fast","linear", function(){}); }) $("#bn-bar").mouseover(function(){clearTimeout(autohide);}); setTimeout(function(){$("#bn-bar").animate({top: "0"}, "slow","linear", function(){});},2500); autohide = setTimeout(function(){$("#bn-bar").animate({top: "-30"}, "fast","linear", function(){});},10000); }) </script> Basically I am trying to load a the message when user enters my website and I will be inserting it via Google Tag Manager. Below is a page where I found the code: Creative Tag Manager – Ads, Promotions, and Visitor Messaging -Lunametrics

    Read the article

  • What is the correct way to restart udev in Ubuntu?

    - by zerkms
    I've changed the name of my eth1 interface to eth0. How to ask udev now to re-read the config? service udev restart and udevadm control --reload-rules don't help. So is there any valid way except of rebooting? (yes, reboot helps with this issue) UPD: yes, I know I should prepend the commands with sudo, but either one I posted above changes nothing in ifconfig -a output: I still see eth1, not eth0. UPD 2: I just changed the NAME property of udev-rule line. Don't know any reason for this to be ineffective. There is no any error in executing of both commands I've posted above, but they just don't change actual interface name in ifconfig -a output. If I perform reboot - then interface name changes as expected. UPD 3: let I explain all the case better ;-) For development purposes I write some script that clones virtual machines (VirtualBox-driven) and pre-sets them up in some way. So I perform a command to clone VM, start it and as long as network interface MAC is changed - udev adds the second rule to network persistent rules. Right after machine is booted for the first time there are 2 rules: eth0, which does not exist, as long as it existed in the original VM image MAC eth1, which exists, but all the configuration in all files refers to eth0, so it is not that good for me So I with sed delete the line with eth0 (it is obsolete and useless in cloned image) and replace eth1 with eth0. So currently I have valid persistent rule, but there is still eth1 in /dev. The issue: I don't want to reboot the machine (it will take another time, which is not good thing on building-VM-stage) and just want to have my /dev rebuilt with some command so I have ready-to-use VM without any reboots.

    Read the article

  • no way to use opendns on pppoe connection?

    - by magisterludi
    I have an old speedtouch usb modem (revision 0) and on my desktop with xubuntu 12.04 I've configured a pppoe connection. I can connect and my ISP assign an IP address and the DNS but the primary DNS address is not reachable by ping, the secondary yes but no address is resolved then I can't surf the web. Then I want to set the open DNS but there is bo way, if I change manually /etc/resolv.conf it is rewrited by some script (there is the flag usepeerdns on the configuration script, if I exclude it there is no way to assign any DNS server because resolv.conf is not read) also if I set not writable the file changing the default permission. I changed dhclient.conf with the code prepend domain-name-servers 208.67.222.222,208.67.220.220; and now if I connect by a wifi connection to my router I'm using openDNS server but ppp does not use this script as long as I can see and the DNS server is always setted by my ISP. How can I use set DNS manually to a PPP connection? Is there any way to change it after the connection? Why NetworkManager is not able to manage my dsl connection, it seems not able to manage the dsl usb cable modem. If I use pppoeconf NetworkManager doesn't start and I have to manually delete the lines added to /etc/network/interfaces because the system is not able to start with full configuration of network If I connect a modem-router to the same line I can surf with the DNS server assigned by my ISP, I can't figure why. Some suggestion? Thanks to all

    Read the article

  • How to resolve strange conflict between form post and ajax post?

    - by Oliver Hyde
    On the one page, I am trying to use ajax to edit existing values. I am doing this by using jQuery Inline Edit and posting away the new data, updating the record and returning with success. This is working fine. Next I have implemented the ability to add new records, to do this I have a form at the end of the table, which submits post data then redirects back to the original page. Each of them work individually, but after I have used the form to add a new record, the inline editing stops to work. If I close the webpage and reopen it, it works fine again until I have used the form and it goes of the rails again. I have tried a number of solutions, clearing session data, giving the form a separate name, redirecting to an alternative page (which does work, but is not ideal as I want the form to redirect back to the original location ). Here is a sample of the view form data: <?php foreach($week->incomes as $income):?> <tr> <td><?php echo $income->name;?></td> <td width="70" style="text-align:right;" class="editableSingle income id<?php echo $income->id;?>">$<?php echo $income->cost;?></td> </tr> <?php endforeach;?> <?php echo form_open('budget/add/'.$week->id.'/income/index', 'class="form-vertical" id="add_income"'); ?> <tr> <td> <input type="text" name="name" class="input-small" placeholder="Name"> <input type="text" name="cost" class="input-small" placeholder="Cost"> </td> <td> <button type="submit" class="btn btn-small pull-right"><i class="icon-plus "></i></button> </td> </tr> <?php echo form_close(); ?> This is the javascript initialisation code: $(function(){ $.inlineEdit({ income: 'budget/update_income/', expense: 'budget/update_expense/' }, { animate: false, filterElementValue: function($o){ if ($o.hasClass('income')) { return $o.html().match(/\$(.+)/)[1]; } else if ($o.hasClass('expense')) { return $o.html().match(/\$(.+)/)[1]; } else { return $o.html(); } }, afterSave: function(o){ if (o.type == 'income') { $('.income.id' + o.id).prepend('$'); } if (o.type == 'expense') { $('.expense.id' + o.id).prepend('$'); } }, colors: { error:'green' } }); }); If I can provide any more information to clarify what I have attempted etc, let me know. Temporary Fix It seems I have come up with a work around, not ideal as I still am not sure what is causing the issue. I have created a method called redirect. public function redirect(){ redirect(''); } am now calling that after the form submit which has temporarily allows my multiple post submits to work.

    Read the article

  • issues horizontal scrolling using jQuery.ScrollTo / jQuery.SerialScroll

    - by kapil.israni
    Hi, I am trying to develop auto horizontal scrolling for our website using - jQuery.ScrollTo / jQuery.SerialScroll. I am not sure if this is the best jquery library to do that, but if there's something better, please let me know. Here's the behavior that I want, check out foursquare's "Recent Activity" list. The data that will refresh will come from a ajax request that I make every few seconds using window.setInterval. I am not really a CSS/java script guy so I havent been able to figure out jQuery.SerialScroll. Here's the website - look at the "Live job Feeds" list. Currently the list does refresh the data coming from the ajax call, but I dont see the effect, the animation, in fact I dont even think serialScroll is being used. Right now I am doing a - $('#feed-ticker').prepend(content) to pre-append the newly arrived data. You can do a view source to look at the current code. Any help would be really appreciated. Thanks.

    Read the article

  • issues with horizontal scrolling using jQuery.ScrollTo / jQuery.SerialScroll

    - by kapil.israni
    Hi, I am trying to develop auto horizontal scrolling for our website using - jQuery.ScrollTo / jQuery.SerialScroll. I am not sure if this is the best jquery library to do that, but if there's something better, please let me know. Here's the behavior that I want, check out foursquare's "Recent Activity" list. The data that will refresh will come from a ajax request that I make every few seconds using window.setInterval. I am not really a CSS/java script guy so I havent been able to figure out jQuery.SerialScroll. Here's the website - look at the "Live job Feeds" list. Currently the list does refresh the data coming from the ajax call, but I dont see the effect, the animation, in fact I dont even think serialScroll is being used. Right now I am doing a - $('#feed-ticker').prepend(content) to pre-append the newly arrived data. You can do a view source to look at the current code. Any help would be really appreciated. Thanks.

    Read the article

  • gridComplete is not working in jquery?

    - by kumar
    script type="text/javascript"> $(document).ready(function() { var RegisterGridEvents = function(excGrid) { //Register column chooser $(excGrid).jqGrid('navButtonAdd', excGrid + '_pager', { caption: "Columns", title: "Reorder Columns", onClickButton: function() { $(excGrid).jqGrid('columnChooser'); }, gridComplete: funtion(){ alert("hello"); } }); $(".ui-pg-selbox").hide(); $('.ui-jqgrid-htable th:first').prepend('Select All').attr('style', 'font-size:7px'); //Register grid resize $(excGrid).jqGrid('gridResize', { minWidth: 350, maxWidth: 1500, minHeight: 400, maxHeight: 12000 }); }; $('#specialist-tab').tabs("option", "disabled", [2, 3, 4]); $('.button').button(); RegisterButtonEvents(); RegisterGridEvents("#ExceptionsGrid") }); </script> i am not able to display hello mesage after the grid loading? thanks

    Read the article

  • Is this a cache problem? (JQUERY)

    - by Scarface
    Hey guys quick question. I have this code that brings in data from a php script and it works fine some of the time. However, once in a while the information will not appear at all in opera if I keep refreshing. About Is every 3 refreshes. It seems to be fine in firefox. Is this a cache problem and can it be fixed? Thanks in advance for any assistance. $.getJSON(files+"comments.php?action=view&load=initial&topic_id="+topic_id+"&t=" + (new Date()), function(json) { if(json.length) { for(i=0; i < json.length; i++) { $('#comment-list').prepend(prepare(json[i])); $('#list-' + count).fadeIn(1500); } } });

    Read the article

  • Is this a cache problem? (JQUERY/OPERA)

    - by Scarface
    Hey guys quick question. I have this code that brings in data from a php script and it works fine in fire fox and mostly opera except one problem. In opera if I keep refreshing the page, once in a while the information will not appear at all. Is this possible to fix? Thanks in advance for any assistance. $.getJSON(files+"comments.php?action=view&load=initial&topic_id="+topic_id+"&t=" + (new Date()), function(json) { if(json.length) { for(i=0; i < json.length; i++) { $('#comment-list').prepend(prepare(json[i])); $('#list-' + count).fadeIn(1500); } } });

    Read the article

  • sed regex to match ['', 'WR' or 'RN'] + 2-4 digits

    - by Karl
    Hi I'm trying to do some conditional text processing on Unix and struggling with the syntax. I want to acheive Find the first 2, 3 or 4 digits in the string if 2 characters before the found digits are 'WR' (could also be lower case) Variable = the string we've found (e.g. WR1234) Type = "work request" else if 2 characters before the found digits are 'RN' (could also be lower case) Variable = the string we've found (e.g. RN1234) Type = "release note" else Variable = "WR" + the string we've found (Prepend 'WR' to the digits) Type = "Work request" fi fi I'm doing this in a Bash shell on Red Hat Enterprise Linux Server release 5.5 (Tikanga) Thanks in advance, Karl

    Read the article

  • Getting a specific number of JSON items with jQuery from tumblr feed

    - by Kevin Whitaker
    Hello all. I'm trying to populate a page with X entries from my tumblr feed, and I'm wondering how I can only pull that X number from the JSON object it returns. Here's my code, pulled from another Stack Overflow post and modified: //Tumblr retrieval $.getJSON("http://tumblr-address/api/read/json?callback=?", function(data) { $.each(data.posts, function(i,posts){ var title = this["regular-title"]; var type = this.type; var date = this.date; var url = this["url-with-slug"]; $('#sideRail ol').prepend('<li><p><a href=' +url +'>' + title + '</a></p><p>' + date + '</p></li>'); }); }); I've tried using a while loop with a counter, but it just repeats everything X times before moving on to the next item in the list. Thanks for any help.

    Read the article

  • JQuery: NOT using document.ready and inserting HTML Tags = is this allowed?

    - by jens
    Hello, is this a valid JQuery usage pattern to : <script type="text/javascript"> $("body").prepend('<input type="hidden" id="error" value="show">'); </script> That is using Jquery to manipulate / insert HTML Tags when the Document has NOT YET been loaded (by not using document.ready for the inserting into the DOM)? (Normally I only use document.ready, but in this case I need to insert some Information into the DOM that then is present, when document.ready is called. This is some kind of "happens-before" relations ship I want to achieve so that I am shure when document.ready is called the inserted Form field is available in the document, as I depend on that information. Thank you very much jens

    Read the article

  • Using colon in html tag and handle its element in javascript

    - by Fabien Bernede
    Hello, why my "myns:button" don't become red in IE 6 / 7 / 8 unlike in Firefox / Opera / Safari / Chrome ? <html> <head> <script type="text/javascript"> window.onload = function() { var tmp = document.getElementsByTagName('myns:button'); for (i = 0; i < tmp.length; i++) { tmp[i].style.color = '#FF0000'; } }; </script> </head> <body> <myns:button>My NS Button</myns:button> </body> </html> I already tried to prepend the following to my js : document.createElement('myns:button'); But that doesn't work in IE, why ? Thanks.

    Read the article

  • Replacing text in NSTextFieldCell inside NSTableView

    - by earl.ct
    Whenever a user would type a number, my app would automatically prepend a currency sign before that number. For example, when the user types "1" in a text field, the text inside it becomes "$1.00". All is good when I use an NSNumberFormatter, an NSTextField, and its delegate method control:didFailToFormatString:errorDescription:. - (BOOL)control:(NSControl *)control didFailToFormatString:(NSString *)string errorDescription:(NSString *)error { if ([[control formatter] isKindOfClass:[NSNumberFormatter class]]) { NSNumberFormatter *formatter = [control formatter]; if ([formatter numberStyle] == NSNumberFormatterCurrencyStyle && ! [string hasPrefix:[formatter currencySymbol]]) { NSDecimalNumber *new = [NSDecimalNumber decimalNumberWithString:string]; if (new == [NSDecimalNumber notANumber]) { new = [NSDecimalNumber zero]; } [control setObjectValue:new]; } } return YES;} Now I would like to have this functionality when a user types a number in a cell inside an NSTableView. I tried using control:didFailToFormatString:errorDescription: but the cell would erase the text instead.

    Read the article

  • How to access the subject of a compose mail item in Outlook

    - by vwfreak034
    In Outlook, I can set the subject for a new message (when composing a new mail message), but I want to prepend text. So I need to get the subject first, and then set it. Outlook.Application application = Globals.ThisAddIn.Application; Outlook.Inspector inspector = application.ActiveInspector(); Outlook.MailItem myMailItem = (Outlook.MailItem)inspector.CurrentItem; if (myMailItem != null && !string.IsNullOrEmpty(myMailItem.Subject)) { myMailItem.Subject = "Following up on your order"; } This code works on replies, but not for new messages, because in that case, myMailItem is null.

    Read the article

  • selecting href not starting with http

    - by sushil bharwani
    using jQuery i am trying to find out all the URLS that user has entered which are not starting with http or https and finally i want to prepend http to all such URLs so that when user clicks on them they are taken to a proper site instead of broken link caused due to entry of URLs without http or https. Also like to mention that User have a field "Websites they Like" where they enter websites of their interest. So if they like stackoverflow, they may end up writing www.stackoverflow.com which will be considered a relative link without http. Also my requirments are such that i cant prompt user to enter http or https before there urls

    Read the article

  • Escaping CURL @ symbol with PHP

    - by bkildow
    I'm writing a php application that submits via curl data to sign up for an iContact email list. However I keep getting an invalid email address error. I think this may be due to the fact that I'm escaping the @ symbol so it looks like %40 instead of @. Also, according to the php documentation for curl_setopt with CURLOPT_POSTFIELDS: The full data to post in a HTTP "POST" operation. To post a file, prepend a filename with @ and use the full path. So, is there anyway to pass the @ symbol as post data through curl in php without running it through urlencode first?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9  | Next Page >