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

javascript embedded within PHP array

Hi, can anyone suggest how to fix this problem:

array("<a
href='javascript:popImage('media/images/schaf2_big.jpg','')'><img
src='media/images/".$spage."_1.gif'></a>","rest of array..."),

As you can see I have a PHP array and inside that I want to set a
javascript popup but the syntax for javascript will not allow it. When
you roll over this in the browser, the link will only show:

"javascript:popImage"

It peters out on the (

so I think - i can use ascii characters (() to complete the
javascript function - but this isnt working either...

Soo - is there another event handler that is better to use? Can anybody
suggest any workaround at all?

I would appreciate your time. Thanks!

Brian

Jul 17 '05 #1
2 2401
ahh - i found the \ escape - this is the fix:

array(\"<a
href='javascript:popImage('media/images/schaf2_big.jpg',\'')'><img
src='media/images/".$spage."_1.gif'></a>","rest of array..."),

For other newbs like me :)

Jul 17 '05 #2
br**********@gmail.com wrote:
Hi, can anyone suggest how to fix this problem:

array("<a
href='javascript:popImage('media/images/schaf2_big.jpg','')'><img
src='media/images/".$spage."_1.gif'></a>","rest of array..."),

It peters out on the (


If you copy/pasted that code, the it peters out on the quotes. Use an
editor that support php highlighting.
Stijn
Jul 17 '05 #3

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

Similar topics

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...
26
by: Don | last post by:
I'm writing an html page with some JavaScript that reads a web page into a client-side temp file, then reformats it, then submits that same file as a URL to the browser for display, via...
22
by: VK | last post by:
A while ago I proposed to update info in the group FAQ section, but I dropped the discussion using the approach "No matter what color the cat is as long as it still hounts the mice". Over the last...
104
by: Leszek | last post by:
Hi. Is it possible in javascript to operate on an array without knowing how mamy elements it has? What i want to do is sending an array to a script, and this script should add all values from...
9
by: chrisspencer02 | last post by:
I am looking for a method to extract the links embedded within the Javascript in a web page: an ActiveX component, or example code in C++/Pascal/etc. I am looking for a general solution, not one...
4
by: roger31 | last post by:
Hello - i have created a simple composite control with drop down list displaying the US States. I have also a Javascript (County.js) file embedded inside the control. The Javascript file has an...
3
by: Ollie Hoad | last post by:
Hello all - I'm a newbie here with a question. I work with a WCMS and what I am attempting to do is extract the image source from a HTML hyperlink/image. In a nutshell, I have created an array...
2
by: neeebs | last post by:
Hi, I'm not sure if this is a javascript problem per se, but here goes. I have an xsl document with a python function defined within a <script> block. Elsewhere in the xsl file, within a python...
9
by: mshepard | last post by:
I am very new to Javascript and would like some advise for the following... a. Declare a variable named rNumber = to the value returned from the randInt() function using 5 as the parameter value. ...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.