Monday, October 23, 2017

CallBack in JavaScript. (Simple javascript function with callback)

function abc(option, callback){
if (option == 1) {
  callback         // no () here
  }
}

function test (){
abc(1, hello())
}
function hello(){
alert('this is hello fnc used as callback');
}
test(); // Finally call here

Saturday, October 14, 2017

Remove version string (.css?v=2.0.1) from any css and javascript url in wordPress

Here is the code


// Remove query string  from static files

function removeJsCssVersionString( $src ) {
 if( strpos( $src, '?ver=' ) )
 $src = remove_query_arg( 'ver', $src );
 return $src;
}
add_filter( 'style_loader_src', 'removeJsCssVersionString', 10, 2 );
add_filter( 'script_loader_src', 'removeJsCssVersionString', 10, 2 );

Sunday, October 1, 2017

[ VueJs Solutions ] - How to remove # in url (Vue 2.0) ?

Problem -  http://localhost:8080/about#/



You want solution like this




Step to solve this issue-
 1. Open YourProjectDirectory/src/router/index.js
2.  place this code below above routes: [
      mode: 'history',

sample code- 

Vue.use(Router)

export default new Router({
  mode: 'history',
  routes: [
    {
      path: '/#',
      name: 'Hello',
      component: Hello
    },
    {
      path: '/about',
      name: 'about',
      component: about
    }
  ]

})