Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 251
  • Last Modified:

ColdFusion with Javascript(Pop up a new window)

Hi, Guys!

I am making a pop-up window with ColdFusion and JavaScript.

codes are as follows:

<!---beginning of codes for pop up ---->

<cfquery name="GetProducts" datasource="TestList">
Select * from tblProducts
</cfquery>

<cfoutput query="GetProducts">
<!---Line11 Is Here---><a href="#"  onClick = "openEachService('flashPresentation2.cfm?pid=#GetProducts.pid#'); return false;"><img src = "images/#GetProducts.pic#" border=0 width="50" height="50"></a>
<hr>
</cfoutput>


<script language='javascript'>
function openEachService(the_url){
var the_window = window.open(the_url,'the_window','height=400,width=330');
the_window.focus(the_url);
}
</script>

<!---end of codes for pop up ---->

****But, a new window does not pop up. Instead, I've got the following error message:

<---beginning of error message--->
Just in time compilation error

Invalid parser construct found on line 17 at position 11. ColdFusion was looking at the following text:

"
Invalid expression format. The usual cause is an error in the expression structure.
The last successfully parsed CFML construct was a CFOUTPUT tag occupying document position (16:1) to (16:30).

<---end of error message--->

If somebody help me, I really appreciate it.

Regards and BestWish, portal123
0
portal123
Asked:
portal123
  • 4
  • 2
  • 2
1 Solution
 
RounehCommented:
<cfoutput query="GetProducts">
<!---Line11 Is Here---><a href="#"  onClick = "openEachService('flashPresentation2.cfm?pid=#GetProducts.pid#'); return false;"><img src = "images/#GetProducts.pic#" border=0 width="50" height="50"></a>
<hr>
</cfoutput>


Your error is in the <a href="#" bit.. You'll need to use double #'s in order to make a single one or Cold Fusion will interpret it as the start of a function or variable.

Replace href="#" with href="##"

Hope this helps.

Regards,
Rouneh
0
 
HamdyHassanCommented:
or you can use
<a href="javascript:void(0);" onClick.....
0
 
portal123Author Commented:
Thank you, Rouneh and HamdyHassan!

A new window can pop up. but I've got anoter error message in a new window, flashPresentation2.cfm

Error messages are as follows:

Error Occurred While Processing Request
Error Diagnostic Information
An error has occurred.

HTTP/1.0 404 Object Not Found

If you have advices, I really appreciate it.


Regards and BestWish, portal123
0
[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

 
RounehCommented:
You may have misspelled the name of the cfm file you're calling. Either that or the file is not in the same location as the file you're calling it from.
There are probably more things that could be wrong, but I'd check those two first.

Regards,
Rouneh
0
 
portal123Author Commented:
Thank you, both buys.

It works now!

I would also give credits to HamdyHassan. How do I do when I would give credits to one more person?
0
 
HamdyHassanCommented:
That's good news.
Forget about splitting, It's a headache, beside Rouneh deserve that.

For Future splitting...
you need to post a request at "Community Support"
0
 
portal123Author Commented:
HamdyHassan,

Please simply put your name. I will accept answer. This is extra points to help you. thanks your help.

http://search.experts-exchange.com/Web/WebDevSoftware/ColdFusion/Q_20530960.html

Regards, portal123
0
 
portal123Author Commented:
Sorry, Not "to help you", But "to help me".

portal123
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now