Mind blowing SEO improving and Google rank increasing Signature Rotator SEO Tool.

Thread: 

How to Create a Js File

Ads
banner
banner
victor Offline referral

Posts: 637
Joined: Jun 2013
Reputation: 33

#1
Senior Member
I am trying to save this JavaScript code using notepad but for some reason notepad doesn't save it as cookie.js

Code:
function createCookie(name,value,days) {
    if (days) {
        var date = new Date();
        date.setTime(date.getTime()+(days*30*24*60*60*1000));
        var expires = "; expires="+date.toGMTString();
    }
    else var expires = "";
    document.cookie = name+"="+value+expires+"; path=/";
}
function readCookie(name) {
    var nameEQ = name + "=";
    var ca = document.cookie.split(';');
    for(var i=0;i < ca.length;i++) {
        var c = ca[i];
        while (c.charAt(0)==' ') c = c.substring(1,c.length);
        if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
    }
    return null;
}
function eraseCookie(name) {
    createCookie(name,"",-1);
}

How can I create .js file using notepad?
invisibe_dude Offline referral

Posts: 825
Joined: May 2013
Reputation: 24

#2
Posting Freak
To create a Js (JavaScript) file simply remove the SCRIPT tags and save it as "cookie.js" using notepad Big Grin
damponting44 Offline referral

Posts: 423
Joined: Oct 2016
Reputation: 0

#3
Senior Member
To make a Js (JavaScript) record essentially evacuate the SCRIPT labels and spare the JavaScript code with a .js expansion utilizing Notepad. This enables you to call the JavaScript when required, rather than having the JavaScript code wrote out in the HTML (Hyper Text Markup Language) code.





User(s) browsing this thread: 1 Guest(s)