Category : cloudflare

I want to call an external plugin, the jquery-validation.js. I have these two options of links: First option, somehow simple, no additional attributes: <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.19.2/jquery.validate.min.js"></script> Second option, somehow complex, with additional attributes. Looks more pro and secure: <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.19.2/jquery.validate.min.js" integrity="sha512-UdIMMlVx0HEynClOIFSyOrPggomfhBKJE28LKl8yR3ghkgugPnG6iLfRfHwushZl1MOPSY6TsuBDGPK2X4zYKg==" crossorigin="anonymous"></script> Actually, I ask in general, not only for jquery, if is better to call ..

Read more

I have HTML+CSS page where have two buttons: <!– Tab links –> <div class="text-center"> <button class="tablinks" onclick="openCity(event, ‘top-reviews’)" id="defaultOpen">Top reviews</button> <button class="tablinks" onclick="openCity(event, ‘most-recent’)">Most recent</button> </div> I want "Top reviews" to be visible by default. So at the end of the page I put simple JavaScript <script> document.getElementById("defaultOpen").click(); </script> which click the "Top reviews" button ..

Read more

I’m a newbie in Cloudflare Workers. How to set CORS in Cloudflare Workers? response = await cache.match(cacheKey); if (!response) { // handle fetch data and cache } const myHeaders = new Headers(); myHeaders.set("Access-Control-Allow-Origin", event.request.headers.get("Origin")); return new Response(JSON.stringify({ response }), { status: 200, headers: myHeaders }); Source: Ask Javascript..

Read more

I use axios to parse a website and I get this error: Error: Request failed with status code 403 I tried to set a custom user-agent but no luck module.exports.get_output = function (url) { axios({ method: ‘get’, url: url, headers: {User-Agent’: ‘Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.192 Safari/537.36’} }) ..

Read more