-
Posts
3,671 -
Joined
-
Last visited
-
Days Won
17
Content Type
Profiles
Forums
Events
Everything posted by niche
-
alert in a php while loop SOLVED with thanks in the final post
niche replied to niche's topic in JavaScript
This is one for my topic scrapbook. This one is truly a keeper! I've been needing something like this for years. Before recently, I didn't understand javascript well enough to even ask this question. A BIG thanks to justsomeguy who framed the answer, and to So Called, who knew he was pointed in the right direction, and to Don E, who solved my problem, and special thanks to dsonesuk who, as usual, provides that "something extra" in his posts. Thanks again to you all. This was a real present to wake up to. -
alert in a php while loop SOLVED with thanks in the final post
niche replied to niche's topic in JavaScript
Thanks again, but no go. Did it display for you? -
alert in a php while loop SOLVED with thanks in the final post
niche replied to niche's topic in JavaScript
Thanks,but I don't need anything back in this case. I just need to display what's in a php var assigned to a JS var when the JS var is rendered in php. This displays nicely, but there's no var in it: <?phpecho '<script type="text/javascript">';echo 'alert("Hello World")';echo '</script>';?> how do I re-define a php var to a JS var when the JS var is being rendered in php? <?php$str = "Hello World";echo '<script type="text/javascript">';echo 'var str = ?????';echo 'alert(str)';echo '</script>';?> -
alert in a php while loop SOLVED with thanks in the final post
niche replied to niche's topic in JavaScript
I'm following you, but how do I get the php variable into the JS var when the JS is rendered in php? Script so far: <?php$str = "Hello World";echo '<script type="text/javascript">';echo 'var str = ?????';echo 'alert(str)';echo '</script>';?> -
Is there a way to produce an alert while a php while loop is running? If so, what's the keyword(s) do I need to reference? I'd like to pause my script as my page is being created.
-
Viola! For some reason the echo inside the second foreach didn't register and I thought it was coming from the for loop. I can't say for a fact I would've made the same mistake if I'd worked the problem earlier in the day. Any way, OUTSTANDING EXERCISE! We can't have too many "go find it in the manual" opportunities and I love the spoiler thing.. I think something like this would be great every two or three weeks. Hopefully, there would be some unifying theme for consecutive exercises and only moderators would initiate the exercises with suggestions from the membership. Bravo justsomeguy!
-
That was a great explanation jsg. I understand. Thanks Now, what about the for loop? Please explain how Array ( [0] => 1 [1] => 2 ) gets turned into this by the for loop? I haven't used for loops much, but I expected something different than: 1 21 1 EDIT: It's like it ran twice. once without the ref and once with, but the second foreach hasn't run.
-
Actually, I'm using a button inside my form instead of an input. I put the onclick in the button and it checks out in ff, ie, s, c, o and validates with a transitional doctype, but not under strict. When I changed onclick to onsubmit and moved it to the form tag, JS failed, but I didn't try to debug.
-
By the numbers then, in Ingolme's #2, the first value is always the reference, when the ampersand is used, to pass a series of values? If so, why does $v echo as "2" after the first foreach? Per Ingolme #2, hasn't $v been re-assigned by "as" to the value of the reference, in this case "1"?
-
Sorry, but can't find the quick reply button. I thought I had one. I've clicked, searched and hovered everything I can find. Is it possible it's disabled somehow?
-
I think I have the answer. How do I use the spoiler?
-
Can you say what the ampersand is doing in the foreach? If not, can you show how to google for it?
-
Is there a term for a form submission that's been disabled and redirected by javascript as in an element that contains something like this? onclick="addBop(this); return false;" :
-
Thanks dsonesuk. I didn't know that. It never hurts to remind ourselves that we'll catch more bees with honey.
-
Editing site html files without having to download them
niche replied to jtwalter's topic in HTML/XHTML
I use FileZilla and it's free. It allows you to edit on your server. All you need is a logon to your FTP. -
Is this what you're talking about? http://www.w3schools.com/css/css_image_transparency.asp
-
I like that scientist, but what putting that array in a table and doing a join? EDIT: That way it can all be done in sql.
-
What happened to follow this topic button? EDIT: It was me. Left my JS turned-off when I stopped last night. First time for that.
-
Have your done the css tutorials?
-
Thanks So Called and Ingolme. We've taken this topic as far as we can.
-
Is there something specific you have in mind in AJAX or are you referring to the general advantage of updating a page client side?
-
What if the refresh is triggered by a form action?