Not able to use some rangy methods

97 views
Skip to first unread message

Tristan Pendergrass

unread,
Oct 8, 2013, 12:12:55 PM10/8/13
to ra...@googlegroups.com
Hi, total rangy beginner here. I was hoping to use it for my project so I downloaded 2.3 today. Unfortunately, I didn't get very far. Calling createRange() on rangy from one of my javascripts resulted in the following error: Uncaught TypeError: Object #<Object> has no method 'createRange' .

Fair enough, I thought, I must have loaded things in the wrong order or not at all. Weirdly though, if I go into console after page load I can execute rangy.createRange() just fine.

The next thing I tried was console.log of rangy and rangy.createRange and rangy.createRange(). The results of that were 
a rangy object (as expected, and containing a createRange function),
undefined,
and finally the error message above. 

Is this a common issue for rangy noobies? I bet it is something basic I have forgotten but I can't figure it out, thanks in advance for any thoughts.

Louis-Dominique Dubeau

unread,
Oct 19, 2013, 8:52:01 AM10/19/13
to ra...@googlegroups.com
On Tuesday, October 8, 2013 12:12:55 PM UTC-4, Tristan Pendergrass wrote:
Is this a common issue for rangy noobies?

I don't think so.
 
I bet it is something basic I have forgotten but I can't figure it out, thanks in advance for any thoughts.

Wild guess: did you forget to initialize rangy? (i.e. call rangy.init()) I call this a "wild guess" because I don't know what the symptoms of trying to use an uninitialized rangy are because I've never tried to use it uninitialized.

If that's not it, then I suggest creating a fiddle (http://jsfiddle.net/) that reproduces your problem and post a link here. This would significantly increase the chance of getting a solution to your problem. You might also find a solution while creating the fiddle.
 

Bryan Paluch

unread,
Oct 23, 2013, 9:36:17 AM10/23/13
to ra...@googlegroups.com
Check to see if your pop up blocker is stopping some things from working. I just experienced this with Chrome's Better Pop up blocker. I allowed the pop up blocker on my site that was using rangy and I was able to use the functions I previously wasn't able to.
Reply all
Reply to author
Forward
0 new messages