Archive

Posts Tagged ‘jQuery’

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

January 12th, 2009 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: , ,
17039 pages viewed, 0 today
11071 visits, 0 today
FireStats icon Powered by FireStats