Connecting Tech Pros Worldwide Help | Site Map

Invisible

  #1  
Old October 8th, 2008, 06:25 AM
lanmind
Guest
 
Posts: n/a
Hello,

I have a PHP script that returns a PHP variable's value (a number in
this case) inside an XML document to the client. Is it possible to
make this number invisible when the user views the returned XML but
still accessible by some javascript?

Thank you
  #2  
Old October 8th, 2008, 08:55 AM
Joe Fawcett
Guest
 
Posts: n/a

re: Invisible


"lanmind" <LANMIND01@gmail.comwrote in message
news:29a0535b-a09c-46bf-a7ef-cb83341a7094@t18g2000prt.googlegroups.com...
Quote:
Hello,
>
I have a PHP script that returns a PHP variable's value (a number in
this case) inside an XML document to the client. Is it possible to
make this number invisible when the user views the returned XML but
still accessible by some javascript?
>
Thank you
Most browsers don't display raw XML, they apply a stylesheet first to turn
it into (X)HTML. If your user is actually seeing the XML then there's
nothing you can do. If they are seeing HTML then you can either:
Store the data in a hidden input element or a variable or a hidden div. This
will be accessible via script but also via view source.
Or
Retrieve the XML via an XmlHTTPRequest. Then process it via script. This way
they won't be able to see it unless they have some sort of helper installed,
Fiddler for example, which can view the raw HTTP traffic.

--

Joe Fawcett (MVP - XML)

http://joe.fawcett.name



  #3  
Old October 8th, 2008, 09:05 PM
lanmind
Guest
 
Posts: n/a

re: Invisible


On Oct 8, 12:48*am, "Joe Fawcett" <joefawc...@hotmail.comwrote:
Quote:
"lanmind" <LANMIN...@gmail.comwrote in message
>
news:29a0535b-a09c-46bf-a7ef-cb83341a7094@t18g2000prt.googlegroups.com...Hello,
>
Quote:
I have a PHP script that returns a PHP variable's value (a number in
this case) inside an XML document to the client. Is it possible to
make this number invisible when the user views the returned XML but
still accessible by some javascript?
>
Quote:
Thank you
>
Most browsers don't display raw XML, they apply a stylesheet first to turn
it into (X)HTML. If your user is actually seeing the XML then there's
nothing you can do. If they are seeing HTML then you can either:
Store the data in a hidden input element or a variable or a hidden div. This
will be accessible via script but also via view source.
Or
Retrieve the XML via an XmlHTTPRequest. Then process it via script. This way
they won't be able to see it unless they have some sort of helper installed,
Fiddler for example, which can view the raw HTTP traffic.
>
--
>
Joe Fawcett (MVP - XML)
>
http://joe.fawcett.name
Hi,

I was thinking I could hide some of the returned XML because of this
at W3C:

"With XSLT you can add/remove elements and attributes to or from the
output file. You can also rearrange and sort elements, perform tests
and make decisions about which elements to hide and display, and a lot
more."

It's here under the "XSLT = XSL Transformations" section:

http://www.w3schools.com/xsl/xsl_intro.asp

I haven't studied XSLT so I didn't know but now I'm thinking "elements
to hide and display" is for for outputting HTML only.

Thank you
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
invisible table columns my.shabby.sheep@gmail.com answers 5 August 31st, 2007 08:15 PM
GridView - Retrieve invisible column information Mel answers 9 August 9th, 2007 04:15 PM
Datagrid invisible Label/Textbox does not generate HTML Object? rockdale answers 3 June 7th, 2006 02:35 PM
Invisible form Jose_Csharp answers 3 November 16th, 2005 06:27 AM
Set all objects in a form to invisible. Cy answers 10 November 13th, 2005 03:26 PM