title: Android webView.loadUrl with quotes
body: <p>With the below java and javascript code; I get an error on this line <code>document.getElementById('txtCardSwipePOS').value = "[SWIPED_CARD]";</code>. If I change the double quotes around <code>[SWIPED_CARD]</code> to single quotes it works.</p>
  
  <p>But then if I have single quotes in my string it does NOT work. Ideally I want to have double quotes around <code>"[SWIPED_CARD]"</code> so the json encode works correctly; but it seems loading javascript via  a url with double quotes doesn't work. Is there a way around this?</p>
  
  <pre><code>    String creditCardSwipe = new String (cardData);
  
      creditCardSwipe = StoreWebActivity.jsonString(creditCardSwipe);
      String javascriptCode = "";
      try {
          javascriptCode = StoreWebActivity.convertStreamToString(getResources().openRawResource(R.raw.credit_card_swipe));
      } catch (NotFoundException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      } catch (Exception e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      }
      int API = android.os.Build.VERSION.SDK_INT;
      javascriptCode = javascriptCode.replace("[SWIPED_CARD]", creditCardSwipe);
  
      //old way of injecting javascript
      if (API &lt; 19)
      {
          webView.loadUrl("javascript:"+javascriptCode);
      }
      else //Android 19 or above
      {
          webView.evaluateJavascript(javascriptCode,null);
      }
  
      //Sometimes swipes can be detected as valid, but in reality aren't so request swipe again
      myUniMagReader.startSwipeCard();
      isWaitingForSwipe = true;
  </code></pre>
  
  <p>R.raw.credit_card_swipe (JS Loaded Above)</p>
  
  <pre><code>if (document.getElementById('txtCardSwipePOS'))
  {
      document.getElementById('txtCardSwipePOS').value = "[SWIPED_CARD]";
  }
  
  if (document.getElementById('divProgressOverlay'))
  {
      document.getElementById('divProgressOverlay').style.display = '';
  }
  
  if (document.getElementById('imgProgress'))
  {
      ProgressImg = document.getElementById('imgProgress');
      setTimeout('ProgressImg.src = ProgressImg.src', 0);
  }
  
  if (document.getElementById('frmCheckout'))
  {
      //Need to use setTimeout for form submission so loading indicators have time to display (this is for Android)
      setTimeout(function()
      {
          document.getElementById('frmCheckout').submit();
      },0);
  }
  </code></pre>