javascript - Cant make text appear with php/ajax code :( -


First check this site:

Hello, Mexico and IM from Mexico, learning HTML, CSS , JS and PHP, for personal purposes.

IM is trying to add that code to my test page, Example 3 example is the Random Fact Generator (form) when you click on random generaton button, this random text appears problem Is this IT reduced? And XML? Php server? ... I do not know..I have not checked anything in all code :(, I can add random text to JS with a case and a random with other methods but I like the page Do any part?

comes from:

View

Then it comes from a PHP file. PHP is reading an XML file, a CSV file, a database etc.

Tell me if you have Still Edit: If you do not want to overwrite the final fact, you have to replace it with script.js:

  if objCurrent (objCurrent). ParentNode.replaceChild (objReplacement, objCurrent); else {Var objContent = document.getElementById ('content'); objContent.appendChild (objReplacement);}   

to

  var objContent = document.getElementById ('content'); objContent.appendChild (objReplacement);   

edit 2: csv file (test.csv)

  1, test1 2, test2 3, test3 4, test4 5, test5   

Here APAP is friendly with the site you provided < / P>

  & lt ;? Php $ handle = fopen ("test.csv", "r"); $ Array = array (); While (($ data = fgetcsv ($ handle, 5000, ",")) == FALSE {array_push ($ array, $ data); } If (count ($ array)> gt; {$ id = rand (0, count (array $ -1); Array $ array [$ id] [1]; }? & Gt;    

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -