Jump to content

aooga

Members
  • Posts

    31
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

aooga's Achievements

Member

Member (2/5)

0

Reputation

  1. Ok I learnt some jQuery, I don't know if it helped. Here's my function: function edituserquestion(questionid, action) { $.post( "index_edituserquestion.php", {questionid: questionid, action: action}, function(xml) { qid = $("questionid", xml).text(); questiontype = $("questiontype", xml).text(); fedituserquestion(qid, questiontype); refreshnreviewnow(); refreshreviewquestions(); } ); } So when I click one one question, calling edituserquestion(30), and quickly click on edituserquestion(20), only edituserquestion(20)'s response is registered. I don't know how to convert this to use global variables. What should I do?
  2. I have a function --> function edituserquestion(questionid, action) { xmlHttp=GetXmlHttpObject();if (xmlHttp==null){alert ("Browser does not support HTTP Request");return;} ...} which calls --> function stateChangededituserquestion() {...} How can I make it that if the user clicks one a button with questionid 5, and before stateChangededituserquestion returns from the server the user clicks on another button with a different questionid, it'll work fine (i.e. the server will process one after the other and my script will deal with them in order?)
  3. HTML: <span id="top"> <span id="bottom"> </span> </span> If my javascript script starts with "bottom", is there a function to get it's immediate ancestor, in this case "top"?
  4. Didn't work for me: now I get '%u05D0' <script type="text/javascript"> function process() { input = document.getElementById("input").value; url = "test2.php"; url += "?input=" + escape(input); window.location.href = url; } </script> <form action='test2.php' method='post'> <textarea id = 'input' name = "input"></textarea> <input type="submit" value="Click here to POST" /> </form> <a href="javascript:process()">Click here to GET</a> <?php $input2 = $_POST['input']; $input = $_GET['input']; $input = urldecode($input); echo $input; echo $input2; ?>
  5. I have a textbox where the user inputs data which is sent to another php file. When the user types in hebrew, it is transferred correctly with POST but not with GET. With POST I get א (the correct input) and with GET I get ×. How can I get it to work with GET? I've isolated the problem to as little code as I can (the actual application uses ajax), here it is: test.php: <script type="text/javascript"> function process() { input = document.getElementById("input").value; url = "test2.php"; url += "?input=" + input; window.location.href = url; } </script> <form action='test2.php' method='post'> <textarea id = 'input' name = "input"></textarea> <input type="submit" value="Click here to POST" /> </form> <a href="javascript:process()">Click here to GET</a> test2.php just gets the get or post. <?php $input2 = $_POST['input']; $input = $_GET['input']; echo $input; echo $input2; ?>
  6. Okay, I suppose I will. It just seems so inelegant. And I suppose in theory, with enough edits, it could bog down performance. But I suppose it's very unlikely to ever reach that point.
  7. I've written a website with php where there are questions arranged as a linked list. I want to convert it to javascript and ajax. There will be default question, the ability to add and delete them etc. So for instead if I start with: <span id='1'>1</span> <span id='2'>2</span> I want to be able to add 1.5 and then delete 1. How do I create 1.5? If I put it right after 1 i.e. <span id='1'>1 <span id='1.5'>1.5</span></span>, then deleting 1 will delete 1.5 too. What should I do? Right now my best idea is rename <span id='1'> to <span id='blah'> and then innerHTML in it <span id='1'> and <span id='2'>, then rename blah to junk. But then after many modifications my page will filled with a bunch of 'junk' spans.
  8. Would removechild remove the elements within the element? is there a way to replace <p id='1'></p> with <p id='1.1'></p> <p id='1.2'></p> ?
  9. If my script will be creating and deleteing spans constantly, is there a way to delete the span itself or do I just have to keep it empty and change it's id to 'empty' or something? Eg.: <span id='1'>1</span> <span id='2'>2</span> Then a function creates 2.1 and 2.2 within span id='2': <span id='2'><span id='2.1'></span><span id='2.2'></span></span> Is there a way to get rid of <span id='2'>?
  10. I've made the code as small as possible to isolate the problem, but this should be enough to demonstrate it. When I click on 1, 2 or 3 then 2 becomes a. Then when I click on a, 3 becomes hello, but b does not become hello. I'm at a loss as to why. Btw: if function a() { document.getElementById('2').innerHTML = "<p onclick='b()'>a</p>"; document.getElementById('2').innerHTML = "hello"; } this would work. It's only if document.getElementById('2').innerHTML = "hello"; is in b() that it doesn't. I'm REALLY curious about this, what am I missing?
  11. <script type="text/javascript"> function a() { document.getElementById('2').innerHTML = "<p onclick='b()'>a</p>"; } function b() { document.getElementById('2').innerHTML = "hello"; // this doesn't work document.getElementById('3').innerHTML = "hello"; // this does } </script> <p id='1' onclick='a()'>1</p> <p id='2' onclick='a()'>2</p> <p id='3' onclick='a()'>3</p>
  12. I want to start out with: <a onclick=somefunction>new number</a> <p onclick=somefunction>1</p> <a onclick=somefunction>new number</a> <p onclick=somefunction>2</p> <a onclick=somefunction>new number</a> <p onclick=somefunction>3</p> <a onclick=somefunction>new number</a> I want to be able to click on everything - on the new number to add a new number to the list, on 1 or 2 or 3 to delete a number from the list. And I'd like to be able to add 1.5, then delete 2 then add 2.5 etc. ending up with 1 1.5 2.5 3 This sounds arbitrary but it's essential for the webpage I've got in mind. Thank you!
  13. For example: http://hypermegaultra.com/editQuestions.php?#602 Note the ? at the begging of the sentence instead of the end.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.