Tag: node

  • Getting headless Chrome to run on AWS Lambda Node

    Getting headless Chrome to run on AWS Lambda Node

    Today I needed to update a couple Lambda functions from the Node 8 runtime to use the Node 10.x runtime. These functions required headless Chrome because they are used to take screenshots. Unfortunately, moving from the Node 8 runtime to 10x runtime is not a simple as it sounds, because AWS have decided to change…

  • Getting all element attribute values with jQuery

    Getting all element attribute values with jQuery

    Here is a little snippet which I have found extremely useful especially when working with XML in Javascript. You can use the following to loop through all of an element’s attributes and store them in an object: [cc lang=”javascript”] var element = $(“#myElement”), attributes = {}; $.each(element.get(0).attributes, function(i, attrib){ attributes[attrib.name] = attrib.value; }); [/cc] So…