I now want to use AJAX $post to the server-side value, how to get the value in Ueditor, my page load code is as follows:
<textarea name="blog_content" id="blog_content"></textarea>
The page can be displayed ueditor.
I now use JQ Ah JS through the id "blog_content" to get the value of alert out all is empty, do not take this value, how can I $post this value ah .... Ask the expert to answer
Reply to discussion (solution)
1. Editor.getcontent () Direct with Ueditor object method
2.$ (' #blog_content '). Val (), you're sure the value is in Blog_content.
I checked the editor's API, I looked at the editor.getcontent () This method, I also used, is also empty. I'm not sure if the value is in Blog_content, with $ (' #blog_content '). Val (); The value is also empty ...
I checked the editor's API, I looked at the editor.getcontent () This method, I also used, is also empty. I'm not sure if the value is in Blog_content, with $ (' #blog_content '). Val (); The value is also empty ...
That should be your fault.
Ue.geteditor (' editor '). GetContent () Take a look at this.
I've just done it before .... Direct $ (' #blog_content '). Val () OK, it's not that complicated ...
I've just done it before .... Direct $ (' #blog_content '). Val () OK, it's not that complicated ...
So why is the value I'm taking out?
I got it wrong ... This has been done a long time ago ... I'm going to use something else, and I really need to see the document.
Reference 2 floor Blackartrock reply: I checked the editor of the API, I looked at the editor.getcontent () This method, I also used, is also empty. I'm not sure if the value is in Blog_content, with $ (' #blog_content '). Val (); The value is also empty ...
That should be your fault.
Ue.geteditor (' editor '). GetContent () Use this ...
This method is easy to use and can fetch the value, thank you.
But why did the post submission of Ajax jump, but also in the address bar to go to the value?
http://blog.local/index.php/admin/blog_c/insertBlog?blog_title=&select_category=%E8%AF%B7%E9%80%89%E6%8B% a9%e6%97%a5%e5%bf%97%e5%88%86%e7%b1%bb&blog_content=%3cp%3eaa%3cbr+%2f%3e%3c%2fp%3e
Look at your. Post how to write ... I guess it was wrong.
What kind of Ajax package are you using?
Like a jquery bag,
$.post (Url,{blog_content:....,select_category:...},function () {
Alert (' Done ')
})
url = "Http://blog.local/index.php/admin/blog_c/insertBlog"
. Post (Url,{blog_title:ue.geteditor (' Editor '). GetContent ()},function (d) {});
Ok?
Look at your. Post how to write ... I guess it was wrong.
$.post (" ",
{blog_title:blog_title,blog_category:blog_category,blog_content:blog_content},
function (data) {
$ (". Category_list"). HTML (data);
});
Submission of a straight point I see in the firebug there is a submission request, but, is red, after the jump will not see
You first alert to submit the value of each item is not what you want ... Although stupid, but a look to know where the wrong
You first alert to submit the value of each item is not what you want ... Although stupid, but a look to know where the wrong
Alert out of the value is not a problem, I have every item shows, is the value I want, but PHP can not receive the post
$_post[' blog_content '), output this, said to be variable blog_content undefined. I think the post submission was unsuccessful because I saw red in the Firebug ....
It's red, but I'm going to jump to the next page, so I can't open it.
I don't know where the problem is .... But according to my own circumstances,
I will first look at the address Firebug submitted to the wrong ... And the bottom of the submission to no ...
The same problem occurred before the other compilers ....
The last is to check the code before and after the wrong to solve the problem.
Try it with Google Chrome
What kind of Ajax package are you using?
Like a jquery bag,
$.post (Url,{blog_content:....,select_category:...},function () {
Alert (' Done ')
})
I'm using the jquery package, the code, and help me see where the problem is.
You send the back and forth ... including blog_title,blog_category:blog_category,blog_content:blog_content
Assign value there ... I'm comparing my eggs with pain. Research and research
Try it with Google Chrome
Just got a chrome, see, How get got ...
The question I find the reason, is my writing has a problem, I wrote a button in the OnClick event, and then investigate a method, but, I think, $.post can only run in $ (function () {}); I rewrote it and added a class to the button. , remove the onclick, and then use JQ wrote a Click, it is good, thank you for your help, knot paste.
Reference 2 floor Blackartrock reply: I checked the editor of the API, I looked at the editor.getcontent () This method, I also used, is also empty. I'm not sure if the value is in Blog_content, with $ (' #blog_content '). Val (); The value is also empty ...
That should be your fault.
Ue.geteditor (' editor '). GetContent () Use this ...
This method is easy to use and can fetch the value, thank you.
But why did the post submission of Ajax jump, but also in the address bar to go to the value?
http://blog.local/index.php/admin/blog_c/insertBlog?blog_title=&select_category=%E8%AF%B7%E9%80%89%E6%8B% a9%e6%97%a5%e5%bf%97%e5%88%86%e7%b1%bb&blog_content=%3cp%3eaa%3cbr+%2f%3e%3c%2fp%3e
Ue.geteditor (' editor '). GetContent () Is this sentence written in JS? Why do I have to be empty when I write this? Seek advice from prawns.
var conte = ue.geteditor (' editor '). GetContent ();
Alert (conte);
I write in JS not get AH.
The problem is the processing of the $_post, if the content of the AJAX submission contains, the "name" to get to the previous value