473,461 Members | 1,504 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

trouble with the & in firefox/javascript

Plater
7,872 Expert 4TB
Firefox is giving me errors whenever I use the &, even in a string. Its starting to make me very frustrated. I cannot use the & code because I actually NEED the & used for querystring.

Expand|Select|Wrap|Line Numbers
  1. XML Parsing Error: not well-formed
  2. Location: http://wan1.platertopia.com:8080/
  3. Line Number 188, Column 34:    var action="DATETIME&TEMPERATURE&HUMIDITY&SAMPLESTATE";
  4. ------------------------------------------------------------^
  5.  
Jul 20 '07 #1
7 1768
Plater
7,872 Expert 4TB
Ok, I'm calling shenanigans on firefox.
shenanigans
shenanigans
shenanigans

Expand|Select|Wrap|Line Numbers
  1. if ((condition1)&(condition2))
  2. {
  3. }
  4.  
Is valid code and should not be harping at me to use & instead as that does not work
Jul 20 '07 #2
iam_clint
1,208 Expert 1GB
have you tried a work around something silly like


var c = "DATETIMEôTEMPERATUREôHUMIDITYôSAMPLESTATE";
action=c.replace("ô", "&");
Jul 20 '07 #3
Plater
7,872 Expert 4TB
have you tried a work around something silly like


var c = "DATETIMEôTEMPERATUREôHUMIDITYôSAMPLESTATE";
action=c.replace("ô", "&");
Yeah, then it complains about there being an & in the .replace function.

Is javascript not allowed in xhtml transitional, is that what it is?
Jul 20 '07 #4
pbmods
5,821 Expert 4TB
If you put <![CDATA[ tags around your Javascript, that should fix it:

Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">
  2.     // <![CDATA[
  3.     .
  4.     .
  5.     .
  6.     // ]]>
  7. </script>
  8.  
Jul 21 '07 #5
kovik
1,044 Expert 1GB
What about using &amp;? That's perfectly valid for URLs.
Jul 21 '07 #6
drhowarddrfine
7,435 Expert 4TB
If you are using that in a URL then ampersand isn't allowed so Firefox is right in complaining. &amp; should work, and it does but you can try %26 which is the encoded version.
Jul 22 '07 #7
Plater
7,872 Expert 4TB
Yeah I finally had a bit more of clairty and google'd it. I had not included that stuff. I was old school with the <!-- stuff, then took it out and it's good now.
If you put <![CDATA[ tags around your Javascript, that should fix it:

Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">
  2.     // <![CDATA[
  3.     .
  4.     .
  5.     .
  6.     // ]]>
  7. </script>
  8.  
Jul 23 '07 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

12
by: PMA | last post by:
Hi all, I am porting a web application from IE 6.0 to FireFox 1.5. I have solved almost all compatibility issues (quite a lot but not too bad) except two of them : 1) Clipboard access thru'...
14
by: Arne | last post by:
A lot of Firefox users I know, says they have problems with validation where the ampersand sign has to be written as &amp; to be valid. I don't have Firefox my self and don't wont to install it only...
12
by: InvalidLastName | last post by:
We have been used XslTransform. .NET 1.1, for transform XML document, Dataset with xsl to HTML. Some of these html contents contain javascript and links. For example: // javascript if (a &gt; b)...
9
by: Dr. Locke Z2A | last post by:
So I'm writing a bot in python that will be able to do all kinds of weird shit. One of those weird shit is the ability to translate text from one language to another, which I figured I'd use google...
0
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
4
Plater
by: Plater | last post by:
I have a simple page that performs a simple request on a 5second interval. It requests some data from a script I have, and then parses and updates the page accordingly. Simple. I am pretty sure my...
3
by: Nathan Sokalski | last post by:
I am adding an onmouseover attribute using the Attributes.Add() method, and the String I am using for the value contains the & character. However, when rendered the & is converted to the HTML...
1
by: littlealex | last post by:
IE6 not displaying text correctly - IE 7 & Firefox 3 are fine! Need some help with this as fairly new to CSS! In IE6 the text for the following page doesn't display properly - rather than being...
5
matheussousuke
by: matheussousuke | last post by:
Hello, I'm using tiny MCE plugin on my oscommerce and it is inserting my website URL when I use insert image function in the emails. The goal is: Make it send the email with the URL...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.