jquery - Use $.get() without dollar sign $

I Got this lines in my Javascript code, and I Cannot use JQuery the $dollar-way, and get in this case doesn't works... I don't receive either the console.log message.

jQuery(document).get(full_event_editor_url, function(text){
    console.log('We can begin to work...');
    // code
});

I need a solution to access another url page to get values, I don't want to load it; only get values inside the function keys.

I tried to use load() function too, but didn't work. I'm working on wordpress theme. My requeriments on JQuery I cannot solve.

Which is the best way to only access another page a time and receive some values.

1 Answer

  1. John- Reply

    2019-11-14

    $ is just an alias for jQuery. If you have another variable already using $, you can call $.noConflict() to prevent conflicts.

    See https://api.jquery.com/jquery.noconflict/

    Try jQuery.get(full_event_editor_url).always(response=> console.log(response));

    Putting your callback function as a parameter of .get() will fail silently, whereas .always() will let you troubleshoot the issue regardless what it returns.

    See https://api.jquery.com/jquery.get/ under The jqXHR Object

Leave a Reply

Your email address will not be published. Required fields are marked *

You can use these HTML tags and attributes <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>