I am using mobile script from website http://mobilizejs.com/, it works for my other website.
My exiting website has a js function like
var anchors = document.getElementsByTagName("a");
for (var i=0; i<anchors.length; i++)
{
var anchor = $( anchors[i] );
if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external")
{
and when i add js from mobilizejs like
<script type="text/javascript" src="http://cdn.mobilizejs.com/releases/0.1/js/mobilize.core.min.js"></script>
Mobile website breaks and i get js error like
anchor.getattribute is not a function
Any ways to solve this error.
You are making jQuery objects from anchors and jQuery objects has no
getAttributemethod. as you are using jQuery you can useeachandattrmethods. Try the following: