title: Uncaught SyntaxError: Unexpected token } when using iFrame
body: <p>I have been trying to use an iFrame to load web pages from an external site. The links to the pages are being dynamically loaded from a web server.</p>
  
  <p>Without the iFrames, the website loads up perfectly, however when I add in the iFrame I get this error: <code>Uncaught SyntaxError: Unexpected token }</code></p>
  
  <p>The Log says it is on line 2 of the HTML file which is: <code>&lt;head&gt;</code></p>
  
  <p>I'm not really sure what's wrong or what to do. Can anybody help me resolve this please?</p>
  
  <p>The iFrame's code looks like: <code>&lt;iframe id="aModule" src="#error"&gt;&lt;/iframe&gt;</code></p>
  
  <p>The src is changed using this function (which is never used because the <code>alert()</code> lines are never triggered:</p>
  
  <pre><code>function setTheModule(link){
  alert();
      document.getElementById("aModule").src = link;
      alert();
  }
  </code></pre>
  
  <p><code>setTheModule</code> is called from another list which is dynamically generated using these methods:</p>
  
  <pre><code>function loadModules(course){
  var data = {
    "fn" : "mod",
    "data": course,
    "ajax" : "true"
  };
  $.ajax({
    type: "GET",
    url: SERVICE_URL, //Relative or absolute path to response.php file
    data: data,
    contentType: "application/json",
    success: function(response) {
  
      var i, list = "";
          for (i = 0; i &lt; response.module.length; i++) {
              list += formatModuleListItem(response.module[i]);
          }
          window.location="#modules";
          $("#mList").html(list).listview('refresh');
    }
  });
  
  }
  
  function formatModuleListItem(item){
  var fItem = "&lt;li class='wrap'&gt;&lt;a href='#' onclick='setTheModule('http://" + item.link +"')'&gt;"+ item.name +"&lt;/p&gt;&lt;/li&gt;";
  return fItem;
  }
  </code></pre>
  
  <p>I really hope somebody can help me :)</p>