Archive

Archive for the ‘jQuery’ Category

jQuery(string) create not valid DOM when string is html with newlines

January 12th, 2009 karlosp No comments
JAVASCRIPT:
  1. function jquery_from_html(data) {
  2.         return $("<div id='inner' />").append(data);
  3. }
  4.  
  5. or
  6.  
  7. remove javascript and head overhead
  8. var htmlDOM = $("<div id='inner' />").append(html.replace(/<script [\s\S]*\/script>|<head [\s\S]*\/head>/img,""));

Categories: jQuery Tags: , ,

Get selected value with jQuery

December 17th, 2008 karlosp No comments
JAVA:
  1. var selected =
  2.  
  3. $("#myList").children("option:selected").attr("value").trim()

Categories: Ajax, jQuery Tags:
101895 pages viewed, 156 today
53334 visits, 92 today
FireStats icon Powered by FireStats