SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Feb 2008
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    String contains an invalid character

    Hi,

    I'm using the prototype framework for element creation.
    However when I try to create a new instance from the Element class an exception is throwed.

    String contains an invalid character
    Code:
    ulab.geo.core.ui.Container = function(parent) {
        this.core = ulab.geo.core.Register.getEntry('core');
        
        if(arguments.length == 0) parent = $(this.core.getMapID());
        
        alert('point 1');
        var t = new Element('div', {id: 'dsds'});
        alert('point 2');
        
        return this;
    };
    Though when I use the old syntax everything goes well.

    Code:
    ulab.geo.core.ui.Container = function(parent) {
        this.core = ulab.geo.core.Register.getEntry('core');
        
        if(arguments.length == 0) parent = $(this.core.getMapID());
        
        alert('point 1');
        var div = document.createElement('div');
        div.setAttribute('id', 'dsds');
        alert('point 2');
        
        return this;
    };
    Any idea what caused this error?

    Thanks!

  2. #2
    Guru in training bronze trophy SoulScratch's Avatar
    Join Date
    Apr 2006
    Location
    Maryland
    Posts
    1,838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmm, I'm not seeing any error doing

    Code:
    	Event.observe(window, 'load', function() {
    	    var t = new Element('div', {id: 'dsds'});
    	    alert(t);
    	});
    Maybe there's some weird *** hidden character.. try retyping or making a new file? I tried this and it seems fine.

    http://www.nabble.com/questions-abou...d15038757.html
    ^ Another person has reported the same problem.

    Try using an updated version of prototype perhaps?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •