marcustephan

Simple jquery

Discussion created by marcustephan on Jun 12, 2017
Latest reply on Jun 28, 2017 by marcustephan

This code:

<script>

$( document ).ready(function() {

console.log('TEST:', $('#j-placeMainNav') );

})

</script>

 

TEST

 

Is producing a $ is not defined

If I use $j(...) the message is $j is not defined

 

This code:

if I do this:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>

<script>

$( document ).ready(function() {

console.log('TEST:', $('#j-placeMainNav') );

})

</script>

 

TEST

 

then I get a:

Any advice so far?

 

I just wanna get the j-placeMainNav and wanna append a new LI dynamically on a specific page

 

(and yes I insert the HTML tile, javascript is in general executed)

Outcomes