?
Solved

ColdFusion with Javascript(Pop up a new window)

Posted on 2003-02-26
8
Medium Priority
?
243 Views
Last Modified: 2013-12-24
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
Comment
Question by:portal123
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2
8 Comments
 

Expert Comment

by:Rouneh
ID: 8026377
<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
 
LVL 9

Expert Comment

by:HamdyHassan
ID: 8026682
or you can use
<a href="javascript:void(0);" onClick.....
0
 

Author Comment

by:portal123
ID: 8027005
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
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 

Accepted Solution

by:
Rouneh earned 800 total points
ID: 8027084
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
 

Author Comment

by:portal123
ID: 8027269
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
 
LVL 9

Expert Comment

by:HamdyHassan
ID: 8027579
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
 

Author Comment

by:portal123
ID: 8027984
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
 

Author Comment

by:portal123
ID: 8027993
Sorry, Not "to help you", But "to help me".

portal123
0

Featured Post

Flexible connectivity for any environment

The KE6900 series can extend and deploy computers with high definition displays across multiple stations in a variety of applications that suit any environment. Expand computer use to stations across multiple rooms with dynamic access.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question