Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't insert images on Firefox #4

Open
ssk opened this issue Dec 14, 2009 · 4 comments
Open

Can't insert images on Firefox #4

ssk opened this issue Dec 14, 2009 · 4 comments

Comments

@ssk
Copy link

ssk commented Dec 14, 2009

When I click an image and select "Thumb" or other size, nothing happens on Firefox 3.5.5. It works on IE 6 & 7.
The error message is the following on firebug:
An invalid or illegal string was specified" code: "12
[Break on this error] results = $A(root.querySelectorAll(e)).map(Element.extend);\n (line 3299)

Prototype version is 1.6.1.

@pjammer
Copy link
Owner

pjammer commented Dec 14, 2009

i'll take a look.i noticed i got it on Safari and FF, on my mac too, when it used to work. wonder if changes to the browser caused it? dunno. let's see what we find.

@ssk
Copy link
Author

ssk commented Dec 14, 2009

I tried to debug it using Firebug. I set a breakpoint at select_thumb(this) but even before I get to that when I click the Thumb link an error occurred. I can't understand this.

This problem happens on Chrome for OS X and Safari.

@pjammer
Copy link
Owner

pjammer commented Dec 15, 2009

so it appears that the function querySelectorAll(e)), according to some javascript docs, breaks if it's not passed everything it's supposed to be passed. so if one of the var attributes isn't passed in, it pukes.

When we look at the e variable, somepeople say to include oldId = '"", so that it gets passed, which may work here.

Do you see that four lines of comment code just above this line? i think it's trying to tell us that, but i don't know how to fix it yet, either.

i don't have prototype 1.6.1, but was using 1.6.0.3. same problems though.

root = root || document;
var e = this.expression, oldId = '', results;

switch (this.mode) {
  case 'selectorsAPI':
    // querySelectorAll queries document-wide, then filters to descendants
    // of the context element. That's not what we want.
    // Add an explicit context to the selector if necessary.
    if (root !== document) {
      var oldId = root.id, id = $(root).identify();
      e = "#" + id + " " + e;
    }

    results = $A(root.querySelectorAll(e)).map(Element.extend);
    root.id = oldId;

    return results;

Try this out in your code, with adding var oldID part added, see if it works.

@ssk
Copy link
Author

ssk commented Dec 17, 2009

For some reason, my comment was not posted. I post it again.

I tried the code you suggested but it didn't work.

I think we need to generalize this problem and post it to other sites and get help from people.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants