milkytiptoe / Name-Sync

Enables names on 4chan's forced anon boards
http://milkytiptoe.github.io/Name-Sync/
Other
18 stars 5 forks source link

addJquery #17

Closed aeosynth closed 12 years ago

aeosynth commented 12 years ago

you should probably just embed jquery into your source

milkytiptoe commented 12 years ago

What's the benefit of doing this?

aeosynth commented 12 years ago

one less network request

aeosynth commented 12 years ago

one less async dance

aeosynth commented 12 years ago

debugging is easier when the lines in your error console match the lines in your source code

aeosynth commented 12 years ago

https://github.com/milkytiptoe/Name-Sync/blob/master/NameSync.user.js#L21-23

        var script = document.createElement("script");
        script.textContent = "(" + a.toString() + ")();";
        document.body.appendChild(script);

hahaha, oh wow - you plug your entire script through this

milkytiptoe commented 12 years ago

Well I'll try and do it then.

haha, oh wow

Jeez. It's copied straight from an example I found months ago online that worked with no side effects.

milkytiptoe commented 12 years ago

https://github.com/milkytiptoe/Name-Sync/commit/b42178840ad501e251023730d745b922e5553e09

I embedded jquery but when I call NameSync() directly (as in not that snippet above) for some reason the 'options' network request doesn't send, it goes straight to the 'get'. Still looking.

aeosynth commented 12 years ago

dude, you should embed jquery outside of any other function. and you don't have to use your init function at all, just directly call NameSync().

milkytiptoe commented 12 years ago

I knew that, but the issue was my server was declining origins not from 4chan.org, but the change doesn't send the origin anymore. Fixed. Thanks aeosynth.