473,387 Members | 1,582 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Invisible

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
Oct 8 '08 #1
2 1253
"lanmind" <LA*******@gmail.comwrote in message
news:29**********************************@t18g2000 prt.googlegroups.com...
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

Oct 8 '08 #2
On Oct 8, 12:48*am, "Joe Fawcett" <joefawc...@hotmail.comwrote:
"lanmind" <LANMIN...@gmail.comwrote in message

news:29**********************************@t18g2000 prt.googlegroups.com...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
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
Oct 8 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Cy | last post by:
I've had good luck with posting in the past, so we'll see how things go this time...:) I have an Access 2000 form. On the form is about 40 objects. I want to set everything to invisible,...
3
by: Jose_Csharp | last post by:
Hi guys, I´m trying to make a startup invisible form. I don´t want a form with Opacity property 0. First I did the property Visible of the form to false. It wasn´t a good idea, was too easy. Then...
3
by: rockdale | last post by:
Hi, All: I have a datagrid with TemplateColumn as following: <asp:TemplateColumn Visible="False" > <ItemStyle Width="0px"></ItemStyle> <ItemTemplate> <asp:Label id="lblMin_Value"...
9
by: Mel | last post by:
I have 10 columns total. 3 of them are invisible. The rest are read- only BoundFields, 3 of which are editable fields using TemplateFields. Upon editing, I want to validate what the user enters...
5
by: my.shabby.sheep | last post by:
Hi, I want to do the following. I want to make a table column invisible to the screen, but I still want to be able to get the innertext that would have been stored in the cell for certain...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.