?
Solved

Help in jQuery closing tags

Posted on 2011-03-09
1
Medium Priority
?
362 Views
Last Modified: 2012-05-11
Hi,

I have a jQuery modal box on my website (it opens on right mouse click).

There are 2 versions and one them works properly the other one doesn't - because I'm confused with all these: { }); ... opening, closing tags

So here is the properly working version:

jQuery("#message1").mousedown(function(e) {
					if (e.which === 3) {
				
					AttentionBox.showMessage("This is a the Hello World example");
				}
				
				});

Open in new window


now here is another version - it works as regular left mouse click:

jQuery("#message9").click(function()
				{
					AttentionBox.showMessage('Share this image online',
					{
						inputs : 
						[
							{caption: "FULL SIZE - copy and paste into forum", value: "[URL=<?php echo curPageURL();?>][IMG]<?php echo Config::$frontendPath.Config::$images['imagePath'].$iv->image['path']; ?>[/IMG][/URL]" }, 
							{caption: "THUMBNAIL - copy and paste into forum", value: "[URL=<?php echo curPageURL();?>][IMG]<?php echo Config::$frontendPath; ?>data/thumbs/<?php echo $iv->image['time']; ?>192x192/<?php echo $iv->image['image']; ?>[/IMG][/URL]" } 
						]
					});
				});

Open in new window


but when I try to modify it, so it opens on right mouse click it doesn't work, I guess I miss one of these });, but I'm not an expert, so I don't know where to put it:

jQuery("#message9")[b].mousedown(function(e) {
					 if (e.which === 3) {[/b]
					 
					AttentionBox.showMessage('Share this image online',
					{
						inputs : 
						[
							{caption: "FULL SIZE - copy and paste into forum", value: "[URL=<?php echo curPageURL();?>][IMG]<?php echo Config::$frontendPath.Config::$images['imagePath'].$iv->image['path']; ?>[/IMG][/URL]" }, 
							{caption: "THUMBNAIL - copy and paste into forum", value: "[URL=<?php echo curPageURL();?>][IMG]<?php echo Config::$frontendPath; ?>data/thumbs/<?php echo $iv->image['time']; ?>192x192/<?php echo $iv->image['image']; ?>[/IMG][/URL]" } 
						]
					});
				});

Open in new window


      
0
Comment
Question by:jhmplondon
[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
1 Comment
 
LVL 19

Accepted Solution

by:
Albert Van Halen earned 500 total points
ID: 35086258
You need a closing curly bracket for the if statement.

jQuery("#message9").mousedown(function(e) {
	if (e.which === 3) {
		AttentionBox.showMessage('Share this image online', {
			inputs : [{
				caption: "FULL SIZE - copy and paste into forum",
				value: "[URL=<?php echo curPageURL();?>][IMG]<?php echo Config::$frontendPath.Config::$images['imagePath'].$iv->image['path']; ?>[/IMG][/URL]"
			},{
				caption: "THUMBNAIL - copy and paste into forum",
				value: "[URL=<?php echo curPageURL();?>][IMG]<?php echo Config::$frontendPath; ?>data/thumbs/<?php echo $iv->image['time']; ?>192x192/<?php echo $iv->image['image']; ?>[/IMG][/URL]"
			}]
		});
	}
});

Open in new window

0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

jQuery is a JavaScript library that greatly simplifies JavaScript programming. AJAX is an acronym formed from "Asynchronous JavaScript and XML."  AJAX refers to any communication between client and server, when the human client does not observe a…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

770 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