473,378 Members | 1,152 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,378 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 1645
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: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.