[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Help in jQuery closing tags

Posted on 2011-03-09
1
Medium Priority
?
366 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

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.

Question has a verified solution.

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

Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer…
This article discusses how to create an extensible mechanism for linked drop downs.
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…

649 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