• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

foreColor, backColor not displayed using jquery

 
Vishal Hegde
Ranch Hand
Posts: 1077
Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Below is the js file which is displaying the below error message

Error:
---------------------------
$(this.css) is not a function
[Break On This Error]

'background-color':backcolor
---------------------------

jquery.highlight.js


highlight.html


Please assist where I am going wrong
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64717
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
$(this.css) is not a function

Is that the valid syntax?

(Hint: no.)

(And please take the time to format your code correctly. What you posted is unacceptably messy.)
 
Vishal Hegde
Ranch Hand
Posts: 1077
Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks , i resolved it.One more issue, what does the last line (jQuery); mean
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64717
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That whole construct is called an immediate function. The function is declared, executed and discarded all in that same statement. The (jQuery) portion of the statement is the function's argument list. It's assigned to the $ parameter of the function.

It forces the $ to equate to jQuery within the function, even if something outside of the function redefines $ to mean something else.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic