JavaScript & Object Oriented Programming (OOP)

 

Advertisements

What does $ sign mean in jQuery?

In the following JavaScript code there is a dollar sign $. What does it mean?


$(window).bind('load', function() {
    $('img.protect').protectImage();
});

By reviewing the jQery Web page, jQuery()===$().

jQuery$(document).ready(function() {
    jQuery$("#myDiv").text("Hello jQuery!");
});

Your snippet of code looks like it’s referencing methods from one of the popular JavaScript libraries (jQuery, ProtoType, mooTools, and so on).

There’s nothing mysterious about the use of $ in JavaScript. $ is simply a valid JavaScript identifier.

JavaScript allows upper and lower letters, numbers, and $ and _. The $ was intended to be used for machine-generated variables (such as $0001).

Prototype, jQuery, and most javascript libraries use the $ as the primary base object (or function). Most of them also have a way to relinquish the $ so that it can be used with another library that uses it. In that case you use jQuery instead of $. In fact, $ is just a shortcut for jQuery.

Taken from StackOverflow

How to display HTML, javaScripts codes on Web.

How to display HTML, javaScripts codes on Web.

CodePen.io testing

<pre><code> … </code></pre>

<pre></pre> is for pre-formatted code

<code></code> is what to use to display code in HTML.
document.getElementById(‘mydiv’)
document.querySelectorAll(‘.button’);
document.querySelector(‘#mydiv’)
document.querySelectorAll(‘.myclass’)
$(‘#mydiv’)
$(‘.myclass’)

Here I am using <pre><code>…</pre></code> below:


//Javascript Example
document.addEventListener('DOMContentLoaded', function() {

    var element = document.querySelector('#mydiv');
    element.addEventListener('click', function() {
      // do something
    });
    
})
    
//JQuery Example
$( document ).ready(function() {

    $("#mydiv").click(function() {
      // do something
    });

});

 

Difference between apur1e.wordpress.com and apurie.com/test17 & Illustrator Tips: Make Texts to Vector

WordPress.com won’t allow all but jetpack pulgins for free users.

So I cannot test “Display Post ShortCode” using categories.
I just reviewed or set: 1. web address, 2. title, 3. tagline, 4. log, and 5. site identity.

The site identity worked on the tab, but no longer working. Maybe it has to be the paying customer.

Two ways to make text -> vector Adobe Illustrator:
  1. select->type-> create outlines, or
  2. select-> object -> expand then checks on object and fill boxes then OK.