Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old May 19th, 2004, 05:52 PM
Friend of Wrox
 
Join Date: Apr 2004
Location: Wausau, WI, USA.
Posts: 121
Thanks: 0
Thanked 0 Times in 0 Posts
Default Not Implemented Error

Anyone ever run into the Not Implemented Error before? I haven't a clue as to what it means. Any help would be appreciated.

Clay Hess
__________________
Clay Hess
Reply With Quote
  #2 (permalink)  
Old May 20th, 2004, 06:20 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 256
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It depends what you're trying to do. You tend to get this error when you are trying to do something (usually involving a redirect - or at least, that's the classic case) that isn't actually supported by the HTTP protocol, for security reasons. There are all sorts of things involving redirects that could be used for Phishing-type attacks on users, if they were implemented within the hypertext protocol.

As was revealed in a recent thread on the PHP lists, redirection is one of the commonest ways in which all the major browsers (yes, Mozilla, too) fail to adhere properly to the standards. See:
ppewww.ph.gla.ac.uk/~flavell/www/post-redirect.html

(Sweet mother of Jesus - third edit! I'd like to see what genius came up with the script for munging URLs on this forum!

Don't just click on the link above, because the ASP scripts this site uses will leave the 'ppe' portion of the hostname off, in the above URL, and I can't work out how to stop it doing so. To summarise: the first portion of the URL above should read 'ppewww', not 'www', as the script seems to think, so just cut&paste the whole URL into a new browser address bar.)
Reply With Quote
  #3 (permalink)  
Old May 20th, 2004, 09:32 AM
Friend of Wrox
 
Join Date: Apr 2004
Location: Wausau, WI, USA.
Posts: 121
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the note, but I am not doing a redirect. Here is the code that is causing the error...

<script language="JavaScript">
function setChecked(selvalue)
{
    if(ID[0][2] == 'Y')
    {
        document.getElementById(selvalue).selectedIndex = 0;
    }
    else
    {
        document.getElementById(selvalue).selectedIndex = 1;
    }
}
onload = setChecked('opt3308');
</script>

All I am trying to do is to set the yes no value of a select menu equal to an array variable. Thoughts on the error?

Quote:
quote:Originally posted by Daniel Walker
 It depends what you're trying to do. You tend to get this error when you are trying to do something (usually involving a redirect - or at least, that's the classic case) that isn't actually supported by the HTTP protocol, for security reasons. There are all sorts of things involving redirects that could be used for Phishing-type attacks on users, if they were implemented within the hypertext protocol.

As was revealed in a recent thread on the PHP lists, redirection is one of the commonest ways in which all the major browsers (yes, Mozilla, too) fail to adhere properly to the standards. See:
ppewww.ph.gla.ac.uk/~flavell/www/post-redirect.html

(Sweet mother of Jesus - third edit! I'd like to see what genius came up with the script for munging URLs on this forum!

Don't just click on the link above, because the ASP scripts this site uses will leave the 'ppe' portion of the hostname off, in the above URL, and I can't work out how to stop it doing so. To summarise: the first portion of the URL above should read 'ppewww', not 'www', as the script seems to think, so just cut&paste the whole URL into a new browser address bar.)
Clay Hess
Reply With Quote
  #4 (permalink)  
Old May 20th, 2004, 09:56 AM
Friend of Wrox
 
Join Date: Jul 2003
Location: , , United Kingdom.
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Clay,

I wasn't getting the same error, but I got your code to work like this...

<script language="JavaScript">
// dummy array for testing
var ID = [[1,2,"N"]];

function setChecked(selvalue)
{
    if(ID[0][2] == 'Y')
    {
        document.getElementById(selvalue).selectedIndex = 0;
    }
    else
    {
        document.getElementById(selvalue).selectedIndex = 1;
    }
}

// you can't set onload this way - you are setting onload to the return value of setChecked()
//onload = setChecked('opt3308');

// but you can create a function to be called when the onload event fires...
onload = function(){setChecked('opt3308')};

</script>

with a select element as follows in the page...

<select id="opt3308">
    <option value="1">one</option>
    <option value="2">two</option>
</select>

Best regards,

Chris

Reply With Quote
  #5 (permalink)  
Old May 20th, 2004, 10:02 AM
Imar's Avatar
Wrox Author
Points: 67,554, Level: 100
Points: 67,554, Level: 100 Points: 67,554, Level: 100 Points: 67,554, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 16,265
Thanks: 66
Thanked 1,428 Times in 1,408 Posts
Default

The error is caused by the way you set the onload handler. I don't think you can set a method name and pass in a variable as well. You'll have to create a new function that calls your code, like this:
Code:
onload = new Function ("setChecked('opt3308');");
Alternatively, and much easier, set the onload attribute of the <body> tag:
Code:
<body onload="setChecked('opt3308');">
Hope this helps,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Getaway Car by Audioslave (Track 13 from the album: Audioslave) What's This?
Reply With Quote
  #6 (permalink)  
Old May 20th, 2004, 10:45 AM
Friend of Wrox
 
Join Date: Apr 2004
Location: Wausau, WI, USA.
Posts: 121
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok...it is as clear as mud to me...I tried it like Chris suggested, I do not get the error, but the script does not work. Plus I do not understand why having function() and putting the actual function inside of {} helps? If someone can expound, I would appreciate it.

Imar, I tried your way with putting it in the body...did not work because I already have an onload in the body tag. As for your other suggestion, you have a function calling a function? how does that help and just how do you do that? I have never done that and do not know the syntax, especially for carrying through values.

Help!

Clay Hess
Reply With Quote
  #7 (permalink)  
Old May 20th, 2004, 10:52 AM
Friend of Wrox
 
Join Date: Nov 2003
Location: , , .
Posts: 1,285
Thanks: 0
Thanked 1 Time in 1 Post
Default

You can put multiple functions inside the onLoad body attribute like this:

<body onload="function1(); function2(163); function3('value');">

HTH,

Snib

<><
Reply With Quote
  #8 (permalink)  
Old May 20th, 2004, 10:52 AM
Imar's Avatar
Wrox Author
Points: 67,554, Level: 100
Points: 67,554, Level: 100 Points: 67,554, Level: 100 Points: 67,554, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 16,265
Thanks: 66
Thanked 1,428 Times in 1,408 Posts
Default

Hi Clay,

I tested the page before I posted it, and it worked fine, so maybe something else is going wrong. Anyway, I don't have a function calling another function, but to the onload event, I assign a new function created on-the-fly. By assigning new Function(bla bla bla) to the onload event, the code bla bla bla is executed.

The onload attribute of the body tags allows multiple function calls. Just separate them with a semi colon:

<body onload="functonA();functionB();setChecked('opt3308 ');">

HtH,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Dirty boots by Sonic Youth (Track 5 from the album: Dirty boots) What's This?
Reply With Quote
  #9 (permalink)  
Old May 20th, 2004, 10:59 AM
Friend of Wrox
 
Join Date: Jul 2003
Location: , , United Kingdom.
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Clay,

If you already have an onload attribute in your body tag, you can add more function calls to this e.g.

<body onload="function1(); function2();">

onload = function(){setChecked('opt3308')}; and onload = new Function ("setChecked('opt3308');"); do the same thing - they create a new function to be executed (but do not call it) when the onload event fires, you need to do this because simply coding onload = setChecked('opt3308'); causes the code on the right of the "=" sign to be evaluated & assigned to the item on the left, in this case onload. If your function had no parameters, you could simply use onload = setChecked;

The reason the code I posted is not working is that by setting a value for the onload attribute in the body tag, you are overriding the onload function specified by onload = function(){setChecked('opt3308')};

Cheers 4 now,

Chris


Reply With Quote
  #10 (permalink)  
Old May 20th, 2004, 11:04 AM
Friend of Wrox
 
Join Date: Apr 2004
Location: Wausau, WI, USA.
Posts: 121
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok, the reason the onload in the body tag won't work is because the select menu is not rendered yet. So it is firing upon something that does not exist. SO that did not work. I tried the following code per Imar and it did not work...thoughts?...


function setChecked0(selvalue)
{
    if(ID[0][2] == 'Y')
    {
        document.getElementById(selvalue).selectedIndex = 0;
    }
    else
    {
        document.getElementById(selvalue).selectedIndex = 1;
    }
}
//onload = setChecked0('opt3308');
onload = new Function ("setChecked('opt3308');");

By the way, when I uncomment my original code, the code itself works but I get the not implemented error.

Clay Hess
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
operation not yet implemented RichardMaly Crystal Reports 11 January 8th, 2013 02:22 PM
Handling isLockedOut isn't implemented Joe@Tulsa BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 1 April 3rd, 2007 05:06 AM
Ok datagrid implemented however macupryk General .NET 1 October 7th, 2004 12:29 PM



All times are GMT -4. The time now is 06:45 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.