Sha256: 4761e3dd9a2d04f97e3eb68e28ffc4a9a7f2b8072568872a72b2b941b4855952

Contents?: true

Size: 1.54 KB

Versions: 11

Compression:

Stored size: 1.54 KB

Contents

debug = this.debug || ( console.log && function(f){console.log(f)} ) || console.debug;
$(function(){
  $("<div id='xx'></div>").appendTo(document.body);
  $("#xx").get(0).innerHTML =
    "<script id='foo0'>debug('shouldnt');</sc"+"ript>";
  v = $("<div></div>").get(0);
  v.innerHTML = "<script id='foo1'>debug('should');</sc"+"ript>";
  $(document.body).append(v);

  n = $("<div>0</div><script id='foo3'>debug('*');</sc"+"ript>");
  m = $("<div>0</div><script src='y.js'></sc"+"ript>"); // debug("**2");
  debug("before add");
  n.appendTo(document.body);
  m.appendTo(document.body);
  // debug(n.get(0).ownerDocument.documentElement.innerHTML);
  debug("after add");
  $("<div>1</div><script id='bar'></sc"+"ript>").appendTo(document.body);
  $("<div>2</div><script id='foobar'></sc"+"ript>").appendTo(document.body);
  $("#bar").attr("src","x.js"); // = debug("**");
  $("#foobar").append(document.createTextNode('debug("***");'));
  setTimeout(function(){
    debug("replace text");
    $("#foobar").text('debug("****");');
    debug("replace attribute");
    $("#bar").attr("src","x.js");
    setTimeout(function(){
      debug("remove attribute");
      $("#bar").attr("src","");
      setTimeout(function(){
        debug("readd attribute");
        $("#bar").attr("src","x.js");
      },100);
    },100);
  },100);
  $("<div id='nope'>huh?</div>").appendTo(document.body);
  $("#nope").get(0).innerHTML = "<script>debug('oops!');</scr"+"ipt>";
  $("#nope script").text("debug('me neither');");
  $("#nope script").attr("src","x.js"); // or me
  debug('loaded');
});

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
envjs19-0.3.8.20101029121421 test/foo.js
envjs-0.3.8 test/foo.js
envjs-0.3.7 test/foo.js
envjs-0.3.6 test/foo.js
envjs-0.3.5 test/foo.js
envjs-0.3.4 test/foo.js
envjs-0.3.3 test/foo.js
envjs-0.3.2 test/foo.js
envjs-0.3.1 test/foo.js
envjs-0.3.0 test/foo.js
envjs-0.2.0 test/foo.js