Re: [WSG] NoScript Help Please!

2008-05-21 Thread Jeffrey Lowder

Hi IceKat

If javascript is required for the link - then write/append it to the  
page using javascript - then if javascript is being used - no link


Cheers
Jeff


On 22/05/2008, at 1:31 PM, IceKat wrote:


Hi,

Thanks to those who have replied so far. I'm still a bit lost  
because this has gotten a bit more complicated so I'll explain a bit.


I have a page which lists records in a mysql database. They each  
have varying options including delete. They are printed with a php  
loop. The table of records is in a form and the delete button has in  
fact become a input type=image which posts some data back to the  
page with a javascript return confirm. The posted data is then  
excecuted. The php and mysql is fine but the javascript is doing the  
confirming which means that if it's turned off then there is no  
confirmation of the delete. This is the reason why I am trying to  
put in a regular image with a link to another page which only  
appears if javascript is disabled.


I know this isn't a JavaScript help page but I'm hoping that someone  
will understand my babbling because I'm having trouble getting this  
to do what I need and validate my page at the same time. The first  
solution posted by Michael seemed good until I realised it was  
actually an input type=image that I needed (sorry about that). The  
solution below seems to do what I need but the complexity of the  
javascript makes me feel cold.


Can anyone either mail me directly to save clogging up this mailing  
list or point me to a place where I can learn what I need? Does  
anyone know a good javascript forum?


Many Thanks,
IceKat

David Dorward wrote:


Three issues:

1: A start tag starts an element, an end tag ends an element, and  
elements must be contained entirely within other elements.


2: noscript is a very poor means of handling the 'no js case', it  
doesn't cope with 'JavaScript supported, but not the functions you  
are calling'


3: Links make GET requests, and GET requests shouldn't do anything  
significant to the server (like deleting files). People have run  
into problems with precaching proxy servers following all the links  
to get the content available for users and deleting lots of files  
as they go. For changes to the server, use POST.


I would do something like this:


 
   
 


And then:

http://yui.yahooapis.com/2.5.1/build/yahoo-dom-event/yahoo-dom-event.js 
">


 function deleteFiles(e, obj) {
YAHOO.util.Event.preventDefault(e); // Don't submit the form normally
   // And then whatever else you want your JS to do
 }
var elements = YAHOO.util.Dom.getElementsByClassName('delete_file', 'form');
 YAHOO.util.Event.addListener(elements, "submit", deleteFiles);


YUI documentation is available from http://developer.yahoo.com/yui/




***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***





***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] NoScript Help Please!


Hi,

Thanks to those who have replied so far. I'm still a bit lost because 
this has gotten a bit more complicated so I'll explain a bit.


I have a page which lists records in a mysql database. They each have 
varying options including delete. They are printed with a php loop. The 
table of records is in a form and the delete button has in fact become a 
input type=image which posts some data back to the page with a 
javascript return confirm. The posted data is then excecuted. The php 
and mysql is fine but the javascript is doing the confirming which means 
that if it's turned off then there is no confirmation of the delete. 
This is the reason why I am trying to put in a regular image with a link 
to another page which only appears if javascript is disabled.


I know this isn't a JavaScript help page but I'm hoping that someone 
will understand my babbling because I'm having trouble getting this to 
do what I need and validate my page at the same time. The first solution 
posted by Michael seemed good until I realised it was actually an input 
type=image that I needed (sorry about that). The solution below seems to 
do what I need but the complexity of the javascript makes me feel cold.


Can anyone either mail me directly to save clogging up this mailing list 
or point me to a place where I can learn what I need? Does anyone know a 
good javascript forum?


Many Thanks,
IceKat

David Dorward wrote:


Three issues:

1: A start tag starts an element, an end tag ends an element, and 
elements must be contained entirely within other elements.


2: noscript is a very poor means of handling the 'no js case', it 
doesn't cope with 'JavaScript supported, but not the functions you are 
calling'


3: Links make GET requests, and GET requests shouldn't do anything 
significant to the server (like deleting files). People have run into 
problems with precaching proxy servers following all the links to get 
the content available for users and deleting lots of files as they go. 
For changes to the server, use POST.


I would do something like this:


  

  


And then:

src="http://yui.yahooapis.com/2.5.1/build/yahoo-dom-event/yahoo-dom-event.js";> 



  function deleteFiles(e, obj) {
YAHOO.util.Event.preventDefault(e); // Don't submit the form normally
// And then whatever else you want your JS to do
  }
var elements = YAHOO.util.Dom.getElementsByClassName('delete_file', 'form');
  YAHOO.util.Event.addListener(elements, "submit", deleteFiles);


YUI documentation is available from http://developer.yahoo.com/yui/




***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] NoScript Help Please!



On 21 May 2008, at 07:11, IceKat wrote:
I'm totally hoping that someone can help me with this. I'm trying to  
use noscript tags but I CANNOT get my page to validate. Below is the  
section which is giving me trouble. Please can someone tell me what  
the trouble is.



noscript>


Three issues:

1: A start tag starts an element, an end tag ends an element, and  
elements must be contained entirely within other elements.


2: noscript is a very poor means of handling the 'no js case', it  
doesn't cope with 'JavaScript supported, but not the functions you are  
calling'


3: Links make GET requests, and GET requests shouldn't do anything  
significant to the server (like deleting files). People have run into  
problems with precaching proxy servers following all the links to get  
the content available for users and deleting lots of files as they go.  
For changes to the server, use POST.


I would do something like this:


  

  


And then:

http://yui.yahooapis.com/2.5.1/build/yahoo-dom-event/yahoo-dom-event.js 
">


  function deleteFiles(e, obj) {
YAHOO.util.Event.preventDefault(e); // Don't submit the form normally
// And then whatever else you want your JS to do
  }
var elements = YAHOO.util.Dom.getElementsByClassName('delete_file', 'form');
  YAHOO.util.Event.addListener(elements, "submit", deleteFiles);


YUI documentation is available from http://developer.yahoo.com/yui/

--
David Dorward
http://dorward.me.uk/
http://blog.dorward.me.uk/




***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] NoScript Help Please!

Hey,

My suggestion would be



And attaching the onclick event to  with return false; to stop it
executing when there is javascript.

The alternative is to have an onload function that puts the image
outside the  and deletes the  element.

Both of these will degrade gracefully without needing that ugly 

Regards,

Michael

On Wed, May 21, 2008 at 4:11 PM, IceKat <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm totally hoping that someone can help me with this. I'm trying to use
> noscript tags but I CANNOT get my page to validate. Below is the section
> which is giving me trouble. Please can someone tell me what the trouble is.
>
> 
>  />
>
> I know it looks odd but this version does exactly what I need. However it
> refuses to validate. I use XHTML 1.0 strict and do not want to step down to
> transitional. Unless someone can tell me how to give javascript priority
> then I need to work this out because if I put the link in on it's own it
> does the javascript part and then does the link and I only want the link to
> be activated if javascript is turned off.
>
> Please someone help. I'm going crazy!
>
> IceKat.
>

-- 
http://mine.mjec.net/


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



[WSG] NoScript Help Please!

Hi,

I'm totally hoping that someone can help me with this. I'm trying to use
noscript tags but I CANNOT get my page to validate. Below is the section
which is giving me trouble. Please can someone tell me what the trouble is.




I know it looks odd but this version does exactly what I need. However it
refuses to validate. I use XHTML 1.0 strict and do not want to step down to
transitional. Unless someone can tell me how to give javascript priority
then I need to work this out because if I put the link in on it's own it
does the javascript part and then does the link and I only want the link to
be activated if javascript is turned off.

Please someone help. I'm going crazy!

IceKat.


-- 
Nothing is impossible, the impossible just takes longer.


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***