RichardRotterdam
Members-
Posts
1,509 -
Joined
-
Last visited
Everything posted by RichardRotterdam
-
Hi, I just created a new topic and noticed that manual bbcode isn't working like it used to work. for example str_replace would give str_replace Could it be turned on again it was quite handy. edit erm sorry guys I see it was already mentioned here http://www.phpfreaks.com/forums/index.php?topic=325648.0
-
look into cURL to get the page content. And then try to parse it with something.
-
window.onload = function() { // do something when the page has been loaded. } I prefer domready using a framework though.
-
Add new html table row and textfield?
RichardRotterdam replied to Jason28's topic in Javascript Help
Try a javascript framework to make DOM manipulating easy. I don't think someone will write a function that you requested for free -
I don't think the or operator is done that way for a start. It should be || And what javascript errors do you get?
-
Actually the code I pasted did work. It's just that the folder value in the plugin doesn't change when you change the pulldown value. Lemme give you an example that might help you out a bit. Read the code for explanation on what it does. If you understand it you should be able to figure out the whole problem. The following code will alert the chosen value when you change the folder Example <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <script type="text/javascript"> // wait till the dom is loaded $(document).ready(function() { // fetch the folder select element var folderMenu = $('#folder'); // when you change the folder do an event folderMenu.change(function() { // fetch the folder that is selected selectedFolder = folderMenu.val(); // alert the current selected folder alert(selectedFolder); }); }); </script> <select id="folder"> <option value="">Choose One</option> <option value="/PATH/TO/DIR1" SELECTED>Path 1</option> <option value="/PATH/TO/DIR2" SELECTED>Path 2</option> <opt
-
Don't get the option value simply get the select element value it's way easier. Other then that since you are using jQuery simply use .val(); change this: var upl = document.getElementById('folder').selectedIndex; var dir = document.getElementById('folder').options[upl].value; to: var dir = $('#folder').val();
-
why the ' ++ ' wrap? why not simply 'folder' : upl,
-
Why not simply run it with warnings and notices on see what happens.
-
What I suggested works fine for me. what does your code look like now? Edit I took a look at the link and noticed the change try a console.log and see if something happens. or do a alert('some text') that way you'll be sure the function runs
-
It does do something it doesn't find the url. It's because jQuery.post() and jQuery.ajax() work differently. Use firebug to see what's going on. If you change $.post to $.ajax and add type:'post as parameter it should prob work. $.ajax({ type:'post' });
-
you forgot a comma after the data line data: { vote: 'b', id: '2', category: '0' },// comma here Have you got something like firebug it's a lot easier to see what you have done wrong if you get some sort off error feedback
-
I think you're using the function incorrect. Try something like: $.post({ url: 'yoururlhere.php', data: {data: 'here'} dataType: 'json', success: function(data) { // do stuff here when the data returns } });
-
This is how I would do it. 1. Put all values in an array. 2. Sort them by value using sort or usort 3. echo the first item.
-
Old bad code to Good new code. HELP!!.
RichardRotterdam replied to gaogier's topic in PHP Coding Help
Try the phpfreaks irc channel that might give you more luck. And where is your question? -
<?php $json = '{ "data": [ { "name": "Social Media Manager", "category": "Local business", "id": "164691116879928" }, { "name": "Support! Muffin the fool (Oldham Chronicle FAKE)", "category": "Community", "id": "181377645219010" }, { "name": "Northplanet", "category": "Local business", "id": "132483460132622" }, { "name": "Social Media Manager", "category": "Application", "id": "102650199811234" }, { "name": "Top Ten Things To Remember Me By!", "category": "Application", "id": "375102030458" } ]}'; $array = json_decode($json, true); var_dump($array); this should easily help you figure it out yourself
-
Try accessing it as an array instead of as an object
-
It took me a while to actually figure out what it is you're trying to solve. Actually I'm still not sure if I get it right so let me ask you. Is this the problem you're having? You have 2 tables: Tutor_profile - tutor_id - religion_id (foreign_key) - tutor_name - etc tutor_educational_level - educational_id - educational_name Do you want the educational_name to be selected in a dropdown menu when you show a tutor profile?
-
The csrf (cross site request forgery) doesn't have much to do with ajax but more with a direct script request since you can't do a cross site ajax request. Can't you simply use a session that prevents a request from a different domain?
-
Lol first impression was "who the hell is starting yet another thread in caps". But I think many people here agree on what you just wrote. I don't even bother reading vanilla js doing ajax stuff.
-
Discovering a redirecting url (like tinyurl)
RichardRotterdam replied to etrader's topic in PHP Coding Help
you could try cURL I think -
-
I'm not too sure if it's a javascript or a common sense issue. What about rename one of the init functions to something else?
-
http://api.jquery.com/text/ http://api.jquery.com/html/