473,396 Members | 1,995 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,396 software developers and data experts.

Javascript/Php quotes problem

5
Hi,
My problem is about slashes and quotes. Im developing a Php game, where I have to generate some Javascript with PHP. The problem I'm currently facing is where the heck should the slashes be :P I have been experienting with this for some time, but without any effect.

$clothing_options value:
Expand|Select|Wrap|Line Numbers
  1. <input type=\"submit\" value=\"Take off\" onclick=\"player_image(\"user_image\",'.$item['id'].')\">'
  2.  
String I'm printing out
Expand|Select|Wrap|Line Numbers
  1. echo "<td><a href=\"#\" onClick='popout(this,\"Amount: ".$items[$a][1]."<br />$clothing_options\");return false;' onmouseout=\"exittoolarea(1250);\"><img src=\"images/things/$item[pilt]\" border=\"0\"></a></td>";
The problem is, that the Take off button doens't work. The javascript (ajax) paar worked fine before I started to recode the window part...Now it gives me "syntax error on line 2", however neather the line 2 in the index.php/module.php or javascript file has anything to do with that.
I know the code is messy and Im sorry for that (but it still is a result of hours of random experiments :P), but any hints what to do would be fine. Or is it even possible to call a function in a function like that?
Dec 16 '07 #1
1 1132
acoder
16,027 Expert Mod 8TB
How does this turn out in JavaScript/HTML? You can use double quotes within single quotes without escaping them and vice versa.
Dec 17 '07 #2

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

Similar topics

4
by: Steven Green | last post by:
I did a clean install of Windows XP on my computer and my javascript will not work. I've tried all types of browsers, I've download the Service pack 1 for XP and IE. I have download java from...
2
by: Aaron | last post by:
how would i use document.write to write this input box? i can do it without quotes but i need them for my purpose <input type="textbox" name="input" value="something"> i did this but it...
1
by: Aaron | last post by:
how would i use document.write to write this input box? i can do it without quotes but i need them for my purpose <input type="textbox" name="input" value="something"> i did this but it...
5
by: Lucian Sandor | last post by:
Hello everyone, While I'm a newbie here, I a not new to google, so please don't send me back, it would be useless. First of all I have to specify I am working on a Blogger.com template, therefore...
4
by: Kaustubh | last post by:
Well Hie, i need all you genius guys help. Well i have databse of quotes in TXT format i want the javascript which ll radomize that database means everytime when user come on my page then script...
12
by: Jeff S | last post by:
In a VB.NET code behind module, I build a string for a link that points to a JavaScript function. The two lines of code below show what is relevant. PopupLink = "javascript:PopUpWindow(" &...
1
by: Chris | last post by:
Hi, This is a very basic problem, but i am not able to solve it. msgStr = "<script language =javascript>alert('An exception abc occured')</script>" Page.RegisterStartupScript("exception",...
5
by: geotso | last post by:
Here is the scenario: 1. I have a table (tblCalendar) with the following fields: caldID caldDate caldTitle caldInfo nWinW nWinH
9
by: paul | last post by:
Hi All, We have a small dilemma. We have the following page: http://giggsey.com/m00Cow.php (don't ask about the content) that we want to turn into an interactive application for some new intake...
2
by: mark4asp | last post by:
How do I include a server tag within a javascript parameter which is itself within a HTML element event. For instance no matter what permutation of quotes I try here I get errors on this line: ...
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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,...
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,...

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.