php vs. js

§

include 

php

<?php include /require

 

javascript

 

function include(path) {
    script = document.createElement("script");
    script.setAttribute("type", "text/javascript");
    script.setAttribute("src", path);

    if (head = document.getElementsByTagName("head")[0]) {
        head.appendChild(script);
    }
}

 

 

To display year

php

<?php echo date(‘Y’); ?>

.js

<script type=”text/javascript”>
var theDate=new Date()
document.write(theDate.getFullYear())
</script>

hackya 는

Attorney, front-end developer, digital media artist, WordPress enthusiast, & a father of 4 wonderful children.

Tags: , , ,

카테고리:

Ω

Leave a Reply

Your email address will not be published. Required fields are marked *