• Hi, I have an error in the console in dev tools, but I do not know what the error is exactly. Is there any way or tool that you can paste an error in and it will tell you.
    Or could you please tell me what this error means. I don’t know what the /:9 means specifically.
    [Deprecation] Resource requests whose artandleatherspencer.local/:9 URLs contained both removed whitespace (\n, \r, \t) characters and less-than characters (<) are blocked. Please remove newlines and encode less-than characters from places like element attribute values in order to load these resources. See https://www.chromestatus.com/feature/5735596811091968 for more details.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi, jillyspence, the following page should give you an explanation of what the problem is: https://portswigger.net/web-security/cross-site-scripting/dangling-markup

    Are you able to paste the code that generated the error in a new reply in this post?

    Thread Starter jillyspence

    (@jillyspence)

    Well, I have been trying to enqueue a script in function.php in the child theme, but it will not work, so I am looking in the dev tools what and if there are any errors. My code will work if I put it in an html widget with the script underneath the html, but It will not work when trying to enqueue it. I need to figure this out, in case I have large scripts to deal with, which will obviously need to be enqueued in functions.php
    My javascript is in a file called main.js in the js folder:
    Ive enqueued it as follows: here is this code and the javascript code in the js folder:

    function childtheme_parent_styles() {
        wp_enqueue_style('parent', get_template_directory_uri().'/css/style.css' );
        wp_enqueue_style('mytheme_main_style', get_stylesheet_uri());
        wp_register_script('main-js', get_stylesheet_directory_uri() . '/js/main.js');
        if( is_page(507) ) {
            wp_enqueue_script( 'main-js');
        }
    }
    
    add_action( 'wp_enqueue_scripts', 'childtheme_parent_styles');

    The js code:

    console.log('executing scripts.js');
    
    setInterval(() => {
        d = new Date(); //object of date()
        hr = d.getHours();
        min = d.getMinutes();
        sec = d.getSeconds();
        hr_rotation = 30 * hr + min / 2; //converting current time
        min_rotation = 6 * min;
        sec_rotation = 6 * sec;
     
        hour.style.transform = <code>rotate(${hr_rotation}deg)</code>;
        minute.style.transform = <code>rotate(${min_rotation}deg)</code>;
        second.style.transform = <code>rotate(${sec_rotation}deg)</code>;
    }, 1000);

    The html:

    <div id="clockContainer">
    
    <div id="hour"></div>
    
    <div id="minute"></div>
    
    <div id="second"></div>
    
    </div>
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to find out what a certain error means in dev tools console’ is closed to new replies.