how i can reinitializing javascript in wordpress what has been create by plugin wordpress

i’m having problem when i want to create mobile optimization in my site,i’m read this url to optimize for mobile,in this case i want to defer all my javascript in my website to speed optimizing and manage javascript,i’m read this tutorial to defer js,i have idea for generate my mobile site in one url with javascript optimize mobile.

the problem is when i want to edit my website in wordpress is seem like all php function, so i can’t defer my function if in my header.php like this:

Read More
.........some code has been not show....
<head>
<meta>........</meta>
<?php if ( is_singular() && get_option('thread_comments') ) wp_enqueue_script('comment-reply'); ?>
    <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo('stylesheet_url'); ?>" />
    <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
    <?php wp_head(); ?>

</head> 

but when i’m view source code in browser i get the javascript :

    <script type="text/javascript" src="http://www.statcounter.com/counter/counter_xhtml.js"></script>
<noscript><div class="statcounter"><a title="web analytics" href="http://statcounter.com/"><img class="statcounter" src="http://c.statcounter.com/7474402/0/706690ab/0/" alt="web analytics" /></a></div></noscript>

i think the javascript generate by plugin of wordpress because i'm using that.

my question:

  1. how i can find the javascript of my plugin of wordpress and setup again with defer function?
  2. if that is not possible how i can generate my website in mobile view without change domain example m.blabla.com..?

thanks for your answer.

Related posts

Leave a Reply

1 comment

    1. You’re barking up the wrong tree with what you’re trying to do. Modifynyour themes/templates/etc so that all JS blocks are at the bottom of your HTML just before the closing BODY tag. This achieves the desired outcome of leaving JS processing until last so it won’t impede page load on any device (mobile or otherwise) and without using any silly PHP.

    2. While this question is moot, you should consider looking for page themes, or redesigning your existing one using Responsive Web Design techniques. This will ensure consistent look and feel regardless of the device used for accessing it. Skeleton.js is a good framework for responsive design, and WebDesignTuts has a great tutorial on using Skeleton.js to build a website.