Need Quick Help

eternalwarrior

Senior Member
Joined
Oct 7, 2012
Messages
1,012
Reaction score
397
Hi,
I have java script in lander. It executes redirect function when a visitor clicks the mouse on any location.

I want to stop the redirect but want to keep the date element. Here's the code:

Code:
<script>var currentDate=new Date();var twoDigitMonth=((currentDate.getMonth()+1)>=10)?(currentDate.getMonth()+1):'0'+(currentDate.getMonth()+1);var twoDigitDate=((currentDate.getDate())>=10)?(currentDate.getDate()):'0'+(currentDate.getDate());var createdDateTo=twoDigitMonth+"."+twoDigitDate+"."+currentDate.getFullYear();var createdDateToNew=twoDigitDate+", "+currentDate.getFullYear();$('.get-dd-mm-yy').html(createdDateTo);var dayNames=new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');var nData=new Date();var dayName=dayNames[nData.getDay()];$('.day-name').html(dayName);Date.prototype.monthNames=["January","February","March","April","May","June","July","August","September","October","November","December"];Date.prototype.getMonthName=function(){return this.monthNames[this.getMonth()];};Date.prototype.getShortMonthName=function(){return this.getMonthName().substr(0,3);};var d=new Date();var fullMonthname=d.getMonthName();var getNewDateFormat=fullMonthname+" "+createdDateToNew;$('.newDateFormat').html(getNewDateFormat);$('.advertorial-page').click(function(event){window.location.href='http://f9c3bmoqs0gvhr6efobaatdk0z.hop.clickbank.net/';event.stopPropagation();})
$('.new-video').click(function(event){event.stopPropagation();});</script>

Any help would be greatly appreciated.
 
Hey buddy, here you go :

Code:
<script>
    var currentDate = new Date();
    var twoDigitMonth = ((currentDate.getMonth() + 1) >= 10) ? (currentDate.getMonth() + 1) : '0' + (currentDate.getMonth() + 1);
    var twoDigitDate = ((currentDate.getDate()) >= 10) ? (currentDate.getDate()) : '0' + (currentDate.getDate());
    var createdDateTo = twoDigitMonth + "." + twoDigitDate + "." + currentDate.getFullYear();
    var createdDateToNew = twoDigitDate + ", " + currentDate.getFullYear();
    $('.get-dd-mm-yy').html(createdDateTo);
    var dayNames = new Array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday');
    var nData = new Date();
    var dayName = dayNames[nData.getDay()];
    $('.day-name').html(dayName);
    Date.prototype.monthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
    Date.prototype.getMonthName = function() {
        return this.monthNames[this.getMonth()];
    };
    Date.prototype.getShortMonthName = function() {
        return this.getMonthName().substr(0, 3);
    };
    var d = new Date();
    var fullMonthname = d.getMonthName();
    var getNewDateFormat = fullMonthname + " " + createdDateToNew;
    $('.newDateFormat').html(getNewDateFormat);
    $('.advertorial-page').click(function(event) {
        
        event.stopPropagation();
    })
    $('.new-video').click(function(event) {
        event.stopPropagation();
    });
</script>
 
Try this code and let me know if it doesn't work :

Code:
<script>
    var currentDate = new Date();
    var twoDigitMonth = ((currentDate.getMonth() + 1) >= 10) ? (currentDate.getMonth() + 1) : '0' + (currentDate.getMonth() + 1);
    var twoDigitDate = ((currentDate.getDate()) >= 10) ? (currentDate.getDate()) : '0' + (currentDate.getDate());
    var createdDateTo = twoDigitMonth + "." + twoDigitDate + "." + currentDate.getFullYear();
    var createdDateToNew = twoDigitDate + ", " + currentDate.getFullYear();
    $('.get-dd-mm-yy').html(createdDateTo);
    var dayNames = new Array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday');
    var nData = new Date();
    var dayName = dayNames[nData.getDay()];
    $('.day-name').html(dayName);
    Date.prototype.monthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
    Date.prototype.getMonthName = function() {
        return this.monthNames[this.getMonth()];
    };
    Date.prototype.getShortMonthName = function() {
        return this.getMonthName().substr(0, 3);
    };
    var d = new Date();
    var fullMonthname = d.getMonthName();
    var getNewDateFormat = fullMonthname + " " + createdDateToNew;
    $('.newDateFormat').html(getNewDateFormat);
    $('.new-video').click(function(event) {
        event.stopPropagation();
    });
</script>
 
Yeah it worked.

Problem Solved. No more help needed.
 
Back
Top