|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hi gang:
Check out my new game: http://webbytedd.com/quarters/ What do you think? Cheers, tedd PS: I originally wrote the game for the Mac over eight years ago. -- ------- http://sperling.com http://ancientstones.com http://earthstones.com |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
[snip]
Check out my new game: http://webbytedd.com/quarters/ What do you think? [/snip] Cool...but why do quarters keep appearing in other piles? |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
tedd wrote:
> Hi gang: > > Check out my new game: > > http://webbytedd.com/quarters/ > > What do you think? > > Cheers, > > tedd > > PS: I originally wrote the game for the Mac over eight years ago. I keep getting JS errors. I get this when I select a coin, or coins, and click remove coins. Line: 122 Char: 3 Error: 'countr' is undefined Code: 0 URL: http://webbytedd.com/quarters/index.php If I tell the computer to start first, I get a JS error that says this: Line: 64 Char: 2 Error: 'document.getElementById(...)' is null or not an object Code: 0 URL: http://webbytedd.com/quarters/index.php Plus, it seems that it is randomly reloading the page and resetting the game. I am using IE 6.0.0029.xxxx Pretty much up to date will all patches and updates. No special add ons. Got any suggestions? -- Jim Lucas "Some men are born to greatness, some achieve greatness, and some have greatness thrust upon them." Twelfth Night, Act II, Scene V by William Shakespeare |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
On Apr 11, 6:49 am, t...@sperling.com (tedd) wrote:
> Hi gang: > > Check out my new game: > > http://webbytedd.com/quarters/ > > What do you think? > > Cheers, > > tedd > > PS: I originally wrote the game for the Mac over eight years ago. > -- > -------http://sperling.com http://ancientstones.com http://earthstones.com Does not work on Firefox on Linux, but on Konquerer it plays fine. Larry |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
Hi gang:
Sorry for the lame app, but the program worked for Safari (Mac and Win). However, I did get it to work for FF and a couple of other browsers (Mac and Win), see again: http://webbytedd.com/quarters But the critter is dead in the water for all versions of IE -- if -- I don't figure out a way around the following single statement. document.getElementById(id).checked = true; Granted it's javascript, but all that line does is to set a checkbox variable (id) to 'on'. Surely, $M code can do that, right? After reading a bunch, it seems that M$ has a better way to do things (big surprise there, huh?) and thus does not use the document.getElementById(id) thing that everyone else in the world uses. Instead, they use something "better" and it's not documented well as is typical. Unfortunately, I have not been able to find a M$ work-a-round. So, what I need is: if (document.getElementById) { document.getElementById(id).checked = true; } else { <<<<< inset solution here. >>>>>> } All the code has to do is to set a simple checkbox to 'on' in IE. Anyone have any ideas? Cheers, tedd PS: I'm going to post this on a js list as well. PPS: You have to wonder how much more technically advanced we would be if we weren't always held back by the "what's in it for me" shortsightedness of M$. -- ------- http://sperling.com http://ancientstones.com http://earthstones.com |
|
|
|
#6 |
|
Messages: n/a
Hébergeur: |
tedd <tedd.sperling@gmail.com> wrote on 04/11/2008 02:49:21 PM:
> But the critter is dead in the water for all versions of IE -- if -- > I don't figure out a way around the following single statement. > > document.getElementById(id).checked = true; > > After reading a bunch, it seems that M$ has a better way to do things > (big surprise there, huh?) and thus does not use the > document.getElementById(id) thing that everyone else in the world > uses. Instead, they use something "better" and it's not documented > well as is typical. > > So, what I need is: > > if (document.getElementById) > { > document.getElementById(id).checked = true; > } > else > { > <<<<< inset solution here. >>>>>> > } The Javascript code below, using either Method 1 or Method 2, works fine in IE 7. Have you tried running it in Firefox with the error console open? I am wondering if there isn't a minor syntax error somewhere. Kirk <html><head><title></title> <script type="text/javascript"> function checkme() { // Method 1 - works fine in IE 7 // if(document.forms[0].test.checked) { // document.forms[0].test.checked = false; // } // else { // document.forms[0].test.checked = true; // } // } // Method 2 - works fine in IE 7 if(document.getElementById('test').checked) { document.getElementById('test').checked = false; } else { document.getElementById('test').checked = true; } } </script> </head> <body> <form action="" method="post"> <input type="checkbox" name="test" id="test" onmouseover="checkme();"> Mouse Me </form> </body></head></html> |
|
|
|
#7 |
|
Messages: n/a
Hébergeur: |
Hello,
I want to return an array from function and reference an index all in one line. Is this possible? In the code below I want I want $yo to be the array(5,6). Here is what I've tried, function returnarray() { return array('lose' => array(5,6), 'win' => array(9,8)); } $yo = returnarray()['lose']; var_dump($yo); This yields a parse error. function returnarray() { return array('lose' => array(5,6), 'win' => array(9,8)); } $yo = {returnarray()}['lose']; var_dump($yo); This yields a parse error. function returnarray() { return array('lose' => array(5,6), 'win' => array(9,8)); } $yo = ${returnarray()}['lose']; var_dump($yo); This gives notices as the result of returnarray() is being converted to a string. $yo === NULL...not what i want. function returnarray() { return array('lose' => array(5,6), 'win' => array(9,8)); } $yo = returnarray()->['lose']; var_dump($yo); This yields a parse error. function returnarray() { return array('lose' => array(5,6), 'win' => array(9,8)); } $yo = ${returnarray()}->['lose']; var_dump($yo); This yields a parse error. Thanks for your in advance. |
|
|
|
#8 |
|
Messages: n/a
Hébergeur: |
Top-posting side comment: It's not nice to hijack threads.
My comments are below... On Apr 11, 2008, at 5:33 PM, Daniel Kolbo wrote: > Hello, > > I want to return an array from function and reference an index all > in one line. Is this possible? > > In the code below I want I want $yo to be the array(5,6). > > Here is what I've tried, > > function returnarray() { > return array('lose' => array(5,6), 'win' => array(9,8)); > } > > $yo = returnarray()['lose']; > var_dump($yo); > > This yields a parse error. > > > function returnarray() { > return array('lose' => array(5,6), 'win' => array(9,8)); > } > > $yo = {returnarray()}['lose']; > var_dump($yo); > > This yields a parse error. > > function returnarray() { > return array('lose' => array(5,6), 'win' => array(9,8)); > } > > $yo = ${returnarray()}['lose']; > var_dump($yo); > > This gives notices as the result of returnarray() is being converted > to a string. $yo === NULL...not what i want. > > function returnarray() { > return array('lose' => array(5,6), 'win' => array(9,8)); > } > > $yo = returnarray()->['lose']; > var_dump($yo); > > This yields a parse error. > > function returnarray() { > return array('lose' => array(5,6), 'win' => array(9,8)); > } > > $yo = ${returnarray()}->['lose']; > var_dump($yo); > > This yields a parse error. > > Thanks for your in advance. Perhaps these pages may assist you: http://php.net/manual/en/function.array.php http://php.net/functions For more immediate , I think you want to do something along these lines: <?php function returnArray ($index) { $arr = array('lose'=>array(5,6), 'win'=>array(9,8)); return isset ($arr[$index]) ? $arr[$index] : 'Index not found'; } $returnTheValueForThis = 'lose'; $result = returnArray ($returnTheValueForThis); var_dump ($result); ?> This var_dump will return: array(2) { [0]=> int(5) [1]=> int(6) } Hope that s. Do some more reading in the manual to yourself out. ![]() ~Philip |
|
![]() |
| Outils de la discussion | |
|
|