• Hi everybody, i’ve got some question, i hooked css and js files, and when i press ctrl u, i see in header what both js files which i hooked are there,

    <script type=’text/javascript’ src=’//host.ho.ua/wp-content/plugins/wordpress-linkbuilder/static/js/delete.js?ver=4.0′></script>

    but if i click on path between script tags, my host says me what it is no page with this path, and if i write after host.ho.ua/wordpress, like this

    <script type=’text/javascript’ src=’//host.ho.ua/wordpress/wp-content/plugins/wordpress-linkbuilder/static/js/delete.js?ver=4.0′></script>

    it finds page, so i think if i can change path, my js and css files will work.
    But how can i do this?)
    thanks for help!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter Wahtel

    (@wahtel)

    I was wrong, i did what i wanted and this did not work(
    Can’t understand, why my CSS and JS files does not work, can somebody who knows, explain me?
    I will be very appreciate!

    Looking in the source of https://host.ho.ua, I don’t see any reference to //host.ho.ua/wp-content/plugins/wordpress-linkbuilder/static/js/delete.js or //host.ho.ua/wordpress/wp-content/plugins/wordpress-linkbuilder/static/js/delete.js

    Did you remove it again?

    Since it’s located in a plugins folder, the plugin itself should load the JS file so you shouldn’t have to load it manually?

    How did you hook it in your site?

    Thread Starter Wahtel

    (@wahtel)

    I am trying to hook js files in my plugin, in backend.

    What i’m doing wrong?

    protected function onBackendInit()
    	{
    		add_action('admin_menu', 'themeOptionsPanelAction');
    		add_action('admin_print_scripts', 'onInitJsAction');
    		add_action('admin_print_styles', 'onInitCssAction');
    	} // end onBackendInit
    
    	public function onInitJsAction()
    	{
    		admin_enqueue_scripts('jquery');
    
    		admin_enqueue_scripts(
    			'deleteDiv',
    	        plugins_url('js/delete.js', __FILE__),
    			array('jquery')
    		);
    
    		admin_enqueue_scripts(
    			'addInput',
    	        plugins_url('js/addInputs.js', __FILE__),
    			array('jquery')
    		);
    
    	} // end onInitJsAction

    I still don’t see the reference in your current site so I can’t check it.

    If you go to Settings – General, what are the entries for WordPress Address (URL) and Site Address (URL)?

    It likely has to do with the fact that you’ve installed it in a subfolder “wordpress” and that when you go to the main domain https://host.ho.ua, it automatically redirects to https://host.ho.ua/wordpress/

    Thread Starter Wahtel

    (@wahtel)

    My WordPress Address (URL) and Site Address (URL) is the same: https://host.ho.ua/wordpress.

    I’ve got a main folder of my site, htdocs, in there i installed folder WordPress, and yes you right, it comes in host.ho.ua and then redirect in
    host.ho.ua/wordpress/.

    I’m sorry, I still don’t see the reference to those JS/CSS files in your current site so I can’t check what your current setup is.

    Thread Starter Wahtel

    (@wahtel)

    How can you see the reference to those JS/CSS files in my current site, if i’m trying to hook up this files in my admin panel on backend?

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘css and js does not working’ is closed to new replies.