The effects of alcohol on sustanon 250 leucine for – real weight loss & bodybuilding benefits?
Search
Close
AI Search
Classic Search
 Search Phrase:
 Search Type:
Advanced search options
 Search in Forums:
 Search in date period:

 Sort Search Results by:

AI Assistant
Uncaught ReferenceE...
 
Notifications
Clear all

Uncaught ReferenceError: wpdiscuzAjaxObj is not defined

5 Posts
3 Users
0 Reactions
2,399 Views
(@colt0356)
Posts: 2
New Member
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 
[#518]

Hello, im trying to Lazy Load Wpdiscuz. So i first dequeue the wpdiscuz-combo.min.js in my functions.php and then i made another script to load the script 2 seconds after everything is loaded in the website.

However when the script is loaded i get the error Uncaught ReferenceError: wpdiscuzAjaxObj is not defined

 

How can i fix this?


 
Posted : 07/07/2020 3:05 pm
Asti
 Asti
(@asti)
Posts: 8267
Illustrious Member Support
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

Hi@colt0356,

Simply you should load (enqueue) the wpdiscuzAjaxObj with the js file. 


In case you want to say thank you! 🙂
We'd really appreciate if you leave a good review on the plugin page.
This is the best way to say thank you to this project and the support team.

 
Posted : 07/07/2020 5:43 pm
(@colt0356)
Posts: 2
New Member
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

And how am i going to do that?

var wpdiscuzAjaxObj = "https://www.abnehmenclub.de/wp-content/plugins/wpdiscuz/utils/ajax/wpdiscuz-ajax.php";

 

doesnt work


 
Posted : 07/07/2020 9:53 pm
Asti
 Asti
(@asti)
Posts: 8267
Illustrious Member Support
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

@colt0356,

wpdiscuzAjaxObj is a global object that includes all wpDiscuz options that necessary for using wpDiscuz js code. You've simply passed the URL, that's wrong. Please see how the object is used in wpDiscuz files and in the same way load (enqueue) it. 

In the code, the wpdiscuzAjaxObj is localized, so if you can find and load (enqueue) the object, it'll work fine. 

More info here: https://developer.wordpress.org/reference/functions/wp_localize_script/


In case you want to say thank you! 🙂
We'd really appreciate if you leave a good review on the plugin page.
This is the best way to say thank you to this project and the support team.

 
Posted : 08/07/2020 11:54 am
(@larryhems)
Posts: 1
New Member
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

If you are using any script file and getting "Uncaught ReferenceError: 'wpdiscuzAjaxObj' is not defined " which means ‘wpdiscuzAjaxObj’ is either a variable or a method which you are trying to use before declaring it using var keyword. This means that there is a non-existent variable referenced somewhere. This variable needs to be declared, or you need to make sure it is available in your current script or scope otherwise , it will endup throwing this ‘wpdiscuzAjaxObj’ is not defined error . This usually indicates that your library is not loaded and JavaScript does not recognize the ‘wpdiscuzAjaxObj’.

To solve this error: Load the jQuery CDN library at the beginning of all your javascript files/scripts which uses $/ jQuery, so that $/jQuery can be identified in scripts .

There can be multiple other reasons for this issue:

  • Conflict with Other Libraries
  • Path to your library included is not correct
  • Llibrary file is corrupted
  • Working offline (when you use CDN)

 


 
Posted : 20/06/2022 10:06 am