• pvijeh

    (@pvijeh)


    Hi,

    I have this jquery code which is working fine when i run it from a plain text file, but it won’t work in wordpress. Any ideas?

    I am loading the jquery 1.10.1 library.

    https://code.jquery.com/jquery-1.10.1.min.js

    var $j = jQuery.noConflict();
    var linkAnchor = $j('#link-apartment-guide');
    var randShareLink = Math.floor(Math.random() * 5) + 1;
    $j(document).ready(function(){
        if (randShareLink === 1){
        linkAnchor.append('case1');
        } else if (randShareLink === 2){
        linkAnchor.append('case2');
        } else if (randShareLink === 3){
        linkAnchor.append('case3');
        } else if (randShareLink === 4){
        linkAnchor.append('case3');
        } else {
        linkAnchor.append('case4');
        }
    });
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘JQuery Working in Plain Text File, but not WordPress’ is closed to new replies.