Jump to content
Larry Ullman's Book Forums

Looping Through An Array One Element At A Time

Recommended Posts

I have always loved those epiphany moments. It's like the natural high that programmers get. Congrats on finishing your page.


Even after seeing your page, it took me a second to figure out what was going on, but I finally figured it out. I guess you just wanted to point out spelling mistakes, etc., right?


Anyway, it seems to work well, although honestly, I'm still not sure why you're using PHP and Ajax, but all the same.


If you don't mind posting your final code sometime, I wouldn't mind critiquing things a bit (and I'll try to be nicer this time).

Link to comment
Share on other sites

Dear Hartleysan et alia,


I've discovered a major flaw in my script, and I'll be working on it.






P.S. The major flaw has been found and fixed! It turns out that an "onload" function added to the script to "zero out" the PhP incrementing-variable was "resetting" the variable each time the "Adjust" button was clicked.


Now, a convenient "initializing" radio button can be clicked to "zero out" this PhP variable.




Now with more regex expressions!

  • Upvote 1
Link to comment
Share on other sites

Hey, HartleySan.


There will be a link on the final Demonstration page to a page showing what each typo regex is looking for in the textarea text.


And, yes, I am familiar with the regexes being used, as I wrote them all. And, I have the empty Aspirin bottle to prove it!


I learned all about regex expressions in PHP for the World Wide Web and PHP 6 and MySQL 5.


But, I'm just a beginner at writing regex expressions. Once I get the whole project online, I am going to encourage others to add regex expressions of their own to the plugin. I'm going to include "shell" code that they can place the different parts of the typo code into, and I'll try to explain where the code goes and what sort of things, like single quote marks ('), have to be escaped.


As a matter of fact, you just gave me an idea. I should probably make some sort of video showing the procedure of adding the code to the various pages involved.


Of, course, the regex() plugin that I found online, http://examplet.buss.hk/jquery/selector.regex.php , has to be hooked up for the expressions to work. I'm adding more expressions to the script right now!


It's a long and boring process, as you can well imagine.






P.S. After I get all of my expressions into my script, you or anyone else can make suggestions here and I'll take care of adding the expressions myself, and give credit to the person in a "comment."

Link to comment
Share on other sites

Yes. I have many thoughts, HartleySan. They all revolve around how I'm going to put together a web page that shows the textarea and has information on it about the jQuery "plugin."


I’m not very good at making a web page look good, so this is always the hardest part of a project.


All that stuff you just mentioned sounds like gobbledygook to me that it may take years to learn.


I haven’t even begun to do things like separate my Javascript from my html like you did in your “window.onload” example.


In a day or two I’ll be putting a link on the textarea page that will show all of the code involved. Maybe when you see it you’ll think of something easy that I can add to the page to improve it.


До свидания,



Link to comment
Share on other sites


  • Create New...