Greasy Fork is available in English.

Дискусии » Разработка

Where do I put the label?

§
Публикуван на: 21.03.2018
Редактиран на: 22.03.2018

Where do I put the label?

My script says at one line to put label on return statement, where is that return statement that it's talking about usualy?

Edit: I kind of fix it, but the script doesn't work at all now.
Edit: I reset the script.

wOxxOmМод
§
Публикуван на: 21.03.2018

In case you're not just talking to yourself, no one can see what happens in your computer so if you want help, you need to post all the relevant details like the code, the error message, and so on.

§
Публикуван на: 22.03.2018

In case you're not just talking to yourself, no one can see what happens in your computer so if you want help, you need to post all the relevant details like the code, the error message, and so on.

}
else{
    console.log("Navigating to latest Troll.");
    sessionStorage.autoLoop = "false";
    https://nutaku.haremheroes.com/battle.html?id_troll=2 = window.location.origin + $("nav div[rel='content'] a:has(.continue_quest)").attr("href");
    return ;
}

Here's the script part. the error is on the last line. With the return thing. It says to label 'https' on the return statement.

wOxxOmМод
§
Публикуван на: 22.03.2018

Yep, that's invalid syntax. There's no need to use location.origin here. To set the attribute value via jQuery you need to put it in quotes as the second parameter of attr() so the entire line before return becomes:

$("nav div[rel='content'] a:has(.continue_quest)").attr("href", "https://nutaku.haremheroes.com/battle.html?id_troll=2");

Публикувайте отговор

Влезте, за да публикувате отговор.