Search Results

Search found 4 results on 1 pages for 'arrel'.

Page 1/1 | 1 

  • Rails escape_javascript creates invalid JSON by escaping single quotes

    - by Arrel
    The escape_javascript method in ActionView escapes the apostrophe ' as backslash apostrophe \', which gives errors when parsing as JSON. For example, the message "I'm here" is valid JSON when printed as: {"message": "I'm here"} But, <%= escape_javascript("I'm here") %> outputs "I\'m here", resulting in invalid JSON: {"message": "I\'m here"} Is there a patch to fix this, or an alternate way to escape strings when printing to JSON?

    Read the article

  • A way to automatically organize #imports in Xcode

    - by Arrel
    I love the "Organize Imports" command in Eclipse to implicitly add and remove classes imported into a source file (as in Java or ActionScript). Is there a command in Xcode to update the #import directives at the top of.m Objective-C files based on the classes referenced within the file?

    Read the article

  • jquery: find common elements in 2 sets of divs

    - by tsiger
    For a markup like this: <div id="set1"> <div id="100">a div</div> <div id="101">another div</div> <div id="102">another div 2</div> <div id="120">same div</div> </div> <div id="set2"> <div id="105">a different div> <div id="101">another div</div> <div id="110">more divs</div> <div id="120">same div</div> </div> As you can see both #set1 and #set2 contain 2 divs with the same id (101, 120). Is it possible somehow with jQuery to find the common elements and add a class to the divs in #set1 that have the same id with divs in #set2? In other words after the script run the above code would look like this: <div id="set1"> <div id="100">a div</div> <div id="101" class="added">another div</div> <div id="102">another div 2</div> <div id="120" class="added">same div</div> </div> <div id="set2"> <div id="105">a different div> <div id="101">another div</div> <div id="110">more divs</div> <div id="120">same div</div> </div> EDIT playing around with it i did something but i am not sure it can go anywhere. I created an array with the ids in both sets and in Firebug i can see an array with the values var arrEl = []; $('#set1 div, #set2 div').each( function(index) { var id = $(this).attr('id'); arrEl.push(id); //maybe somehow check the array for the values that appear twice, and add the class to the //matching divs? });

    Read the article

1