Git Product home page Git Product logo

Comments (8)

oscarotero avatar oscarotero commented on August 11, 2024

Hi haraldo.
Can I see your code? I have tested in IE9 and jQuery seem to be fine. Remember that you need to pass the jQuery object to ready function, for example: ready: function ($) { //the jQuery object is "$" }

from bookmarklets.

haraldo avatar haraldo commented on August 11, 2024

Thanks for getting back to me. When I pass in the jQuery object $ I get: "$ is not a function in firebug (firefox)". On the other hand if I do not pass the object it all works, in all browsers except IE9.

Here is the top section of my current options file that works in all browsers except IE9:

css: '',
js: 'http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js',
ready: function() {

    if ($('#div_bookmarklet').length == 0) { // line19

The errors in IE9 are as follows:

SCRIPT5007: Unable to get value of the property 'css': object is null or undefined
bookmarklet.js, line 23 character 4

SCRIPT5007: Object expected
options-local.js, line 19 character 3

I must stress that I do not get these errors in any other browser! Just IE9!
Thanks for your time.

from bookmarklets.

haraldo avatar haraldo commented on August 11, 2024

Bookmarklet.js

window.bookmarklet = {
    css: {},
    js: {},
    jquery: false,

launch: function (file) {
    if (!file) {
        return false;
    }

    this.loadJS(file, function () {
        var options = window.bookmarklet.options;

        if (typeof(options.css) != 'object') { //Line 23

from bookmarklets.

oscarotero avatar oscarotero commented on August 11, 2024

Hi.
I've made a simple change in bookmarklet function (I use window.jQuery instead just jQuery to get the jQuery object). Let me know if it works for you.
Thanks for you feedback.

from bookmarklets.

haraldo avatar haraldo commented on August 11, 2024

Will do. By the way, thanks for this great framework.

from bookmarklets.

haraldo avatar haraldo commented on August 11, 2024

I've updated the bookmarklet.js file and cleared my cache.

I've changed my code from: (WORKS WELL IN ALL BROWSER EXCEPT IE9)

css: '',
js: 'http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js',
ready: function() {

if ($('#div_bookmarklet').length == 0) { // line19

To the following (as it seemed to make more sense): (DOESN'T WORK THE WAY I IMAGINED)

jquery: 'http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js',
ready: function($) {

    if ($('#div_bookmarklet').length == 0) {

However, in Firefox I now get the following error: (When testing on www.amazon.com)

Error: $ is not a function
Source File: http://www.amazon.com/
Line: 1

In IE9 I get:

SCRIPT438: Object doesn't support property or method 'ready' 
bookmarklet.js, line 59 character 6
SCRIPT5007: Unable to get value of the property 'noConflict': object is null or undefined 
bookmarklet.js, line 55 character 7

IE9 goes on to error my iFrame jQuery stuff but I'm not sure that's relevant at the moment.

If you are interested I can email you a link to my test server where you can bookmark the bookmarklet and test for yourself.

from bookmarklets.

haraldo avatar haraldo commented on August 11, 2024

Hi again.

When reverting to: (WORKS WELL IN ALL BROWSERS EXCEPT IE9)

js: 'http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js',
ready: function() {

    if ($('#div_bookmarklet').length == 0) {

IE9 errors with:

SCRIPT438: Object doesn't support property or method 'ready' 
bookmarklet.js, line 59 character 6
SCRIPT5009: '$' is undefined 
options-local.js, line 18 character 3

CSS error seems to be fixed with your update.

Errors that show from code loaded within iFrame:

SCRIPT5009: 'Date' is undefined 
jsapi?key=ABQIAAAAPrMho-79RR39tWYy1sHmSRTP2MS9RAW53iEpyKgL9vwtnCQPqBTvNuILcwQoZ57XRjAbZCap6afYpA, line 1 character 26
SCRIPT5009: 'Object' is undefined 
jquery.min.js, line 2 character 7746
SCRIPT5009: 'jQuery' is undefined 
jquery-ui.min.js, line 10 character 2
SCRIPT5009: 'jQuery' is undefined 
jquery.cookie.js, line 60 character 1
SCRIPT5009: '$' is undefined 
aHR0cCUzQSUyRiUyRnd3dy5nb29nbGUuY28udWslMkY-, line 33 character 2
SCRIPT5009: '$' is undefined 
aHR0cCUzQSUyRiUyRnd3dy5nb29nbGUuY28udWslMkY-, line 45 character 2
SCRIPT5009: 'encodeURIComponent' is undefined 
ga.js, line 1 character 48

The first error here is the google key I send for including jQuery (all these errors come from within iFrame)

from bookmarklets.

oscarotero avatar oscarotero commented on August 11, 2024

Hi, haraldo.
I'd like test your bookmarklet. You can send me a message with the url.
Thank you

from bookmarklets.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.