The effects of alcohol on
sustanon 250 leucine for – real weight loss & bodybuilding benefits?
Uncaught ReferenceError: wpdiscuzAjaxObj is not defined
✦ Summarize Topic
✦
✦
✦
AI is analyzing the discussion...
How-to and Troubleshooting
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
Show original
Translating...
Jul 07, 2020 3:05 pm
(@colt0356)
New Member
Joined: 6 years ago
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?
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
Show original
Translating...
Jul 07, 2020 5:43 pm
(@asti)
Illustrious Member
Joined: 8 years ago
Hi@colt0356,
Simply you should load (enqueue) the wpdiscuzAjaxObj with the js file.
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
Show original
Translating...
Jul 07, 2020 9:53 pm
(@colt0356)
New Member
Joined: 6 years ago
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
(@asti)
Joined: 8 years ago
Illustrious Member
Posts: 8210
Jul 08, 2020 11:54 am
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
Show original
Translating...
@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/
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
Show original
Translating...
Jun 20, 2022 10:06 am
(@larryhems)
New Member
Joined: 4 years ago
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)