![]() |
Ajax wizards in here
Ok so I was using the GET method up until I realized I can't send paragraphs of textarea data, so I converted it to POST, but it's still cutting my paragraphs off??
Sorry this doesn't paste well here. Quote:
|
|
jQuery man, jQuery ;)
The sooner you start using it, the sooner the headaches disappear. |
Son of a bitch.
What's jquery got to do with this though? That shit looks way out of wack, like my headaches would disappear and migraines begin lol. I see a lot of people in google have found the solution by converting to POST, but mine isn't working. |
...or dreamweaver CS4, integrates ajax beautifully
|
that sure is messy code compared to a few lines of jquery
|
Didn't test it at all... and you need to load the jquery libraries.
Code:
Jquery: |
It's already been said and solved, but jq is the way to go forsure. There are some nice new ajax features in the newest version (1.4).
|
Best. Forum. Evar.
Is it safe to load the libraries from Google? Hopefully they aren't changing the paths any time soon.. Edit: fuck, need your own API key to load from Google? This jquery shit is looking to be too much of a hassle, if other people are going to be using this then they're going to have to have these libraries installed and shit? Do most servers have this already? |
jQuery is amazing - Use it immediately! :thumbsup
Get jQuery from jquery.com, don't include it from Google. |
Quote:
just direct link to the library, or direct link to it off of jquery.com http://jet.li/twitter/ this is something i did that uses some jquery to load via search. |
Or Prototype :P I'm a big fan of being able to create classes... although I will admit jQuery is pulling ahead in the race. If jQuery UI wasn't so bloated I'd consider switching faster.
|
I don't see any good reasons not to load from Google. People are most likely going to have it cached already..
This jQuery shit is fucking UGLY man.. why does it have to look like this wtf lol. |
Quote:
i think my code is way more sexy then what you originally posted.... :winkwink: |
Quote:
|
Ok I'm reading a bunch of stuff trying to figure all this jQuery mess out. Even though most of the tutorials online expect you to know a ton of shit already, but first..
How do I even call what you gave me within my HTML form? There's the Quote:
Should I remove the .hide()'s and use something like Quote:
|
lookup .submit
|
Quote:
|
Quote:
|
Quote:
If it's a form submit and the div is to show based on submit response, why not use jQuery thickbox. There's got to be one of those examples that fits your needs (scroll down to the last AJAX example)? And damn simple to boot. |
Quote:
|
Ok I managed to get something extremely simplified so that even I can understand it and someone can hopefully understand what I'm trying to do lol. Only one problem I have. I want the jQuery to just display whatever the PHP sends back to it, instead of having to go through all the json crap and having the jQuery handle what gets shown. Ex (I use tabs so the indents are gone sry):
The js/jquery: Quote:
Quote:
Quote:
$return_json = "{'delimiter':'".$_POST['delimiter']."'}"; and make it send all the HTML/etc I want to display? Like: $everything="<b>blah blah blah ".$_POST['delimiter']."</b>"; $return_json = "{'everything':'$everything'}"; Edit: it works^ I guess I will just do it that way, but idk if it's the wrong way or it doesn't matter or what. I just don't want to handle all the printing and HTML in jquery because it's really going to clutter a lot of shit up. And having to rename all the $_POST's is just stupid imo I don't really understand the whole json thing. |
You don't have to use json
|
Ok I replaced the <input> field with a textarea and it won't print anything if I have more than 1 line of text inside the textarea... what the faaaaaaack!
|
below is your function changed to return html
Code:
$.post("ajaxwork.php?a=import_videos", $("#target").serialize(), Quote:
Code:
echo htmlentities($return_json); |
Changing the json to html makes it show nothing, no matter what I try to pass to it..
Edit: json_encode() seems to do the trick. Edit 2: Well I finally got it to work with the multiple textarea lines, but now I'm back to the original problem where ajax wouldn't POST a large paragraph of text, and this jquery is passing even less text through, this is ridiculous.. |
Ok it's only returning a limited amount of text because of ' (single quotes) within the text.
I already have json_encode(nl2br($_POST['text_dump'])) what else? htmlentities and htmlspecialchars aren't helping. |
Here we go
json_encode(nl2br(str_replace("'","& #39;",$_POST['text_dump']))) I just wanted to be able to send an FLV dump of text via ajax and I had to go through all this crap lol. |
I made you an example...
http://lifestyleamateurs.com/test.php this is the php script I am posting to. Code:
<?php |
btw... if you are going to be working with Ajax I highly recommend firebug... it's really your best tool for debugging ajax calls.
|
Quote:
Your server doesn't have magic_quote or some abomination on does it ? If you're looking to secure text for a database insert, mysql_real_escape_string() |
Quote:
Bump for the code monkeys. |
Quote:
|
now i know why babelogger is so horribly coded ;)
|
Quote:
And yeah certifiedhosting did have magic quotes on, just turned it off. I also installed firebug a couple days ago but haven't restarted firefox yet since I have like 30 damn tabs open. Thanks a million, hopefully I won't have to come back here and 'bug' ya'll again lol. |
Quote:
|
All times are GMT -7. The time now is 12:30 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123