1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Render Blocking Script

Discussion in 'JavaScript' started by kertoon, Sep 26, 2019.

  1. #1
    It is a random-post widget script. When checked with speed tool, the javascript: https://mysite.blogspot.com/feeds/posts/default?alt=json-in-script&callback=rp_results_label&max-results=10 was remarked as a render blocking JS.

    I tried adding either both "asyn" and "defer" in the script. And the widget disappeared.

    How do I fix this?
    SEMrush
     
    kertoon, Sep 26, 2019 IP
    SEMrush
  2. sarahk

    sarahk iTamer Staff

    Messages:
    25,987
    Likes Received:
    3,763
    Best Answers:
    105
    Trophy Points:
    665
    #2
    Choose a better blogging platform?
     
    sarahk, Sep 26, 2019 IP
  3. kertoon

    kertoon Well-Known Member

    Messages:
    155
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    133
    #3
    Actually how should I tweak the script so that I do not have this problem?
     
    kertoon, Sep 26, 2019 IP
  4. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,265
    Likes Received:
    1,784
    Best Answers:
    242
    Trophy Points:
    515
    #4
    Being that it's blogspot, that's out of your control. NOT something you get to change. I'm a bit surprised you'd even be able to add attributes to it since ... are you sure you're using blogspot?

    Basically, you're SOL. S*** outta luck if so. Hence @sarahk's comment.

    Though, without seeing the actual site and knowing what the offending script does, even if you could change it we can't tell you how or where. "random post widget script" could mean almost anything, though it sounds like a crappy poorly written third party extension / mod / plugin / pickAHuffingNameForTheseAlready,

    That said, generally the first move to fix this is to move it out of <head> and to right before </body>. But that only works if the script is applying itself to the existing markup properly, something I can't guarantee without seeing the offending script and the markup it is being applied to.
     
    deathshadow, Sep 27, 2019 IP
  5. kertoon

    kertoon Well-Known Member

    Messages:
    155
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    133
    #5
    Okay, I will just remove this offending script right away. Thanks.
     
    kertoon, Sep 27, 2019 IP
  6. scu8a

    scu8a Greenhorn

    Messages:
    81
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    15
    #6
    The attributes async and defer can only be used if the script is placed in the head section of the web page. If the script is placed in the body, the async and defer attributes aren't recognized. Other than that, I don't know enough about what you're working on to give any answer.
     
    scu8a, Dec 15, 2019 IP