I have never tried to use javascript in wordpress post before. Today, when I tried it does not work. I tried several scripts, and none work.
For example,<Script type="text/javascript"> alert("test");</script>
In the past, I have tried to use SweetCaptcha, and it did not work. I am thinking this may also have to do this issue.
Has anyone had a similar situation?
I have disabled ALL plugins just to ensure there are no conflicts with them.
I deactivated all plugins again, and activated them, and now it works. I did this several times before, but I guess that was the issue
Remove all spaces from your code. Try this:
<script type="text/javascript">alert("test");</script>
I have never tried to use javascript in wordpress post before.
Javascript should work if pasted into the HTML version of the Post/Page editor. It does not work if pasted into the visual editor. If pasted into the visual editor the string will be encoded and won't work. I just tested it.
Related
My WordPress visual editor is not working. I tried all of the solutions on the Google but nothing changed.
Visual editor is not disabled for me (Checked it from profile page and enabled/disabled for times)
CONCATENATE_SCRIPTS to false not working.
WP_DEBUG to true not working.
Tried with different users not working.
Disabled all plugins not working.
Tried with different browser/computer not working.
No error output on JS Console
Tried with plain permalink, not working.
I’m really getting crazy with it. I’m using latest WP version and 2017 theme. Any other solutions?
Edit: I checked the Network Tab on the Developer Console, tinymce.min.js file doesn't exist there. It's not loading. Loaded JS Files:
jquery.js?ver=1.12.4
jquery-migrate.min.js?ver=1.4.1
utils.min.js?ver=4.7
plupload.full.min.js?ver=2.1.8
hoverIntent.min.js?ver=1.8.1
common.min.js?ver=4.7
admin-bar.min.js?ver=4.7
heartbeat.min.js?ver=4.7
autosave.min.js?ver=4.7
suggest.min.js?ver=1.1-20110113
wp-ajax-response.min.js?ver=4.7
wp-ajax-response.min.js?ver=4.7
jquery.color.min.js?ver=2.1.1
wp-lists.min.js?ver=4.7
core.min.js?ver=1.11.4
widget.min.js?ver=1.11.4
mouse.min.js?ver=1.11.4
sortable.min.js?ver=1.11.4
postbox.min.js?ver=4.7
position.min.js?ver=1.11.4
menu.min.js?ver=1.11.4
wp-a11y.min.js?ver=4.7
autocomplete.min.js?ver=1.11.4
tags-suggest.min.js?ver=4.7
tags-box.min.js?ver=4.7
underscore.min.js?ver=1.8.3
word-count.min.js?ver=4.7
post.min.js?ver=4.7
editor-expand.min.js?ver=4.7
thickbox.js?ver=3.1-20121105
shortcode.min.js?ver=4.7
backbone.min.js?ver=1.2.3
wp-util.min.js?ver=4.7
wp-backbone.min.js?ver=4.7
media-models.min.js?ver=4.7
wp-plupload.min.js?ver=4.7
mediaelement-and-player.min.js?ver=2.22.0
wp-mediaelement.min.js?ver=4.7
media-views.min.js?ver=4.7
media-editor.min.js?ver=4.7
media-audiovideo.min.js?ver=4.7
mce-view.min.js?ver=4.7
jquery.imgareaselect.min.js?ver=4.7
image-edit.min.js?ver=4.7
svg-painter.js?ver=4.7
wp-auth-check.min.js?ver=4.7
quicktags.min.js?ver=4.7
wplink.min.js?ver=4.7
media-upload.min.js?ver=4.7
wp-embed.min.js?ver=4.7
wp-emoji-release.min.js?ver=4.7
Had the same problem with no solution so far, but:
when not only deactivating but also deinstalling TineMCE Advanced, everything is working as desired.
Already opened an issue on their wordpress-Plugin page.
Thank you for your answers, I found my problem. My wp-tinymce.php file has 777 permission btw server was blocking this file.
My solution was making its permission to 644..
Same problem here with a fresh install of version 1.4.7.
No problem with my updated websites !
EDIT
Solution to fix the issue:
Copy /wp-admin/ and /wp-includes/ folders from an automatic uptdated WordPress website.
Replace all these file into your broken website.
If someone want these files, I created a link here.
I was trying to take a working jQuery snippet (it's an example to another SO answer) and improve it.
The original snippet can show a good and a bad way of doing something, by having to comment/un-comment some code. I tried to modify the HTML and the JS so that both examples can be run independently, without modifying JS code (by basically cloning sample HTML into a copy with different IDs).
Original JSFiddle worked fine: http://jsfiddle.net/thangchung/LVAaV/
My "improved" version doesn't seem to work at all: http://jsfiddle.net/dvkdvk/C2YBE/19/
(doesn't work means that when you push any button, nothing happens).
I don't know how to debug it with jQuery (with regular JS I would just sprinkle alert() everywhere). I ran "JSHint" on JSFiddle and it was OK.
Your new fiddle did not select a library. Select it from the left side of the form and click Run.
I found this by using Firebug's script debugger in Firefox. Turn on script debugging with the developer tools in your browser of choice. Otherwise, Javascript fails silently. You can then set breakpoints, look at variables, etc. That is much more efficient than using Alerts and console logs (although they do have their place).
Your main problem is with your JSFIDDLE setup. On the left hand side of the page, make sure you include the jQuery library and select onDomReady from the frameworks and extensions panel.
I tried running this script in FireFox, Firebug. The scrips runs fine here with me. Kindly see the environment in which you are trying to run this script.
I cannot coax the datetimepicker to work. Datepicker works fine. But the add-on has not worked after about 7 hours of attempts.
Firebug shows no 404's.
All jQuery libraries are included with the theme framework as well.
I tried replacing all instances of $.datepicker with jQuery.datepicker in the script. This made no difference.
I tried moving scripts above or below or combining them. The same error persists. I have examined several related answers in this forum and many, many others to no avail. I have reviewed jQuery literature but it does not address this specific problem..
My code is this. Just a couple of html inputs. Datepicker works fine.
`jQuery(document).ready(function(){
jQuery('#datepicker').datepicker();
});
jQuery(document).ready(function(){
jQuery('#datetime').datetimepicker();
});`
This segment of code works fine. Datetimepicker then hits the line
$.datepicker.parseDateTime = function(dateFormat, timeFormat, dateTimeString, dateSettings, timeSettings) {
$.datepicker not defined.
If you do not know the answer, perhaps there is a way for javascript/jQuery to produce more detailed information about its failures?
Change to this
jQuery(document).ready(function(){
$.datepicker.parseDateTime = function(dateFormat, timeFormat, dateTimeString, dateSettings, timeSettings){};
});
Looks like you are trying to call the function before it gets loaded. Jquery will go through each doc.ready function in order, so as long as this is after the initial load it should work.
Also, use chrome's built in develop tools for debugging purposes. Ctrl-shift-j on a PC will open them up, you can see the console messages to figure out whats going on.
heres a jsfiddle to show the working syntax http://jsfiddle.net/XA79k/
( function($$) {
$$(document).ready(function(e) {
$.datepicker.parseDateTime = function(dateFormat, timeFormat, dateTimeString, dateSettings, timeSettings) {
});
} ) ( jQuery );
I had similiar issues and had to do it this way since there was conflicts. And I tried jQuery.noConflict() aswell, but didnt work. Above code worked for me.
I've just realized that tinyMCE is not working when you use firefox 5.0
First I thought that's my fault with some script , but then I went straight to TinyMCE demo page http://www.tinymce.com/tryit/full.php and there was the same result.
In normal way you open page, see editor, see text inside editor.
With firefox you see editor, but nothing is inside textarea. It is empy, blank. And what's more strange there is no mouse cursor inside of it. You cannot set it there, thus you cannot write there.
Later on I made one notice.
I've started to refresh the page fast, many times so the browser cannot work fast.
And I saw that it writes textarea, then converts it into tinyMCE editor with all text inside of textarera, and then on the final step it hides or removes all the data from textarea, leaving empty editor with all buttons visible.
Any idea what's going on?
Of course I've posted this on TinyMCE forum, and bugreported it also, but things there run very slow, and on StackOverflow I've got used to fast answers :)
So if anyone has any idea about how can I fix it please tell me.
UPDATE
I think something is wrong with my computer.
I've just tested cuteEditors demo and it acts the same way
http://cutesoft.net/example/general.aspx
So I think problem is inside my computer.
Is it Firefox or what?
SOLVED
Plugins were the problem. I disabled all the plugins and everything works fine!
SOLVED Plugins were the problem. I disabled all the plugins and everything works fine!
I am trying to make a simple Safari 5 Extension that just injects a custom javascript. Any ideas how can I make use of jQuery in this custom script, please? I only know it's possible, because it is mentioned on one of WWDC videos, but I don't know how to do it.
Thanks
You can include jquery.js as a "start script". Your regular script (as an "end script") will see it.
I believe that if you don't need to keep jQuery updated, just copying the source code of jQuery into your extension's code base should work.