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

Jquery concatenation ?

gautamz07
Expand|Select|Wrap|Line Numbers
  1. $('#gallery a').click(function(evt){
  2. evt.preventDefault();
  3. var imgPath = $(this).attr('href');
  4. var oldImage = $('#photo img');
  5. var newImage = $('<img src="' + imgPath + '">');
  6. newImage.hide();
  7. $('#photo').prepend(newImage);
  8. newImage.fadeIn(1000);
  9. oldImage.fadeOut(1000,function(){
  10.     $(this).remove();
  11.     }); //end Fadeout
  12.     });//end click    
  13.     $('#gallery a:first').click();
  14. }); // end ready
  15.  
How does the concatination on line 5 really work and what is it really doing , i understand that its appending 'imagePath' .. but how exactly is it doing it ? and what are all this " ' for , i mean so many of them
Apr 21 '14 #1
4 1641
Dormilich
8,658 Expert Mod 8TB
and what are all this " ' for , i mean so many of them
attribute values should be quoted and must be quoted if the attribute value contains whitespace. hence the need to put quote marks inside the quote mark delimited strings.

i understand that its appending 'imagePath' .. but how exactly is it doing it ?
plain old string concatenation?
Apr 21 '14 #2
thank you sir , but i still did't understand what exactly is the single quotation for and the double quotation for ! even though u say its the same old concatination !!!
Apr 21 '14 #3
Dormilich
8,658 Expert Mod 8TB
hm, let me put it this way: how would you print a quote mark?
Apr 21 '14 #4
in javascript if i have to print out a string along with a value , u concatinate it like this :

var a= 3;
console.log("the value of a is " + a + "and you will see this printed to the console");
Apr 22 '14 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: DuaneMoraes | last post by:
A new book on jQuery, the powerful JavaScript library, has been announced by Packt In Learning jQuery, Karl Swedberg and Jonathan Chaffer, creators of the popular jQuery learning resource...
1
by: mikeh3275 | last post by:
I'm new to developing in jQuery, so I'm probably doing this wrong. I'm loading a form into a modal dialog box and I'm trying to assign a click event to the button in the form, but I can't seem to...
83
by: liketofindoutwhy | last post by:
I am learning more and more Prototype and Script.aculo.us and got the Bungee book... and wonder if I should get some books on jQuery (jQuery in Action, and Learning jQuery) and start learning about...
26
by: RobG | last post by:
Do some of the regulars here need to re-think their (sometimes strident) opposition to libraries? Both Microsoft and Nokia have announced support for jQuery. It seems to have gained quite a bit...
53
by: souporpower | last post by:
Hello All I am trying to activate a link using Jquery. Here is my code; <html> <head> <script type="text/javascript" src="../../resources/js/ jquery-1.2.6.js"</script> <script...
0
by: zeckdude | last post by:
Hi, I am having some issues with my site. I have a main Nav with four links that load in 4 different sections. You can see the page I am working on here:...
0
by: amskape | last post by:
hi Friends, I need to Upload some files in a Listing , by clicking corresponding Upload link, then a popup window will come with Browse option as Shown in attachment File. My actual need is...
1
by: omar999 | last post by:
hi guys i really dont understand where i am going wrong.I've read countless articles including http://blog.nemikor.com/2009/10/03/using-multiple-versions-of-jquery/ but still having trouble with...
0
by: bala venkata siva ram kum | last post by:
Hi all, I am working with menu. for that i download(jquery code) in the net. I included that code in my project in Scripts folder. I take an default2.aspx page which was not included with...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.