Package com.google.gwt.dom.client

Examples of com.google.gwt.dom.client.ScriptElement


  @Override
  public void init(String userAccount) {
    Element firstScript = Document.get().getElementsByTagName("script").getItem(
        0);

    ScriptElement config = Document.get().createScriptElement(
        "var _gaq = _gaq || [];_gaq.push(['_setAccount', '" + userAccount
            + "']);_gaq.push(['_trackPageview']);");

    firstScript.getParentNode().insertBefore(config, firstScript);

    ScriptElement script = Document.get().createScriptElement();

    // Add the google analytics script.
    script.setSrc(("https:".equals(Window.Location.getProtocol())
        ? "https://ssl" : "http://www") + ".google-analytics.com/ga.js");
    script.setType("text/javascript");
    script.setAttribute("async", "true");

    firstScript.getParentNode().insertBefore(script, firstScript);
  }
View Full Code Here


   }

   private void startLoading()
   {
      assert state_ == State.Start;
      ScriptElement script = document_.createScriptElement();
      script.setType("text/javascript");
      script.setSrc(url_);
      registerCallback(script);
      Element head = document_.getElementsByTagName("head").getItem(0);
      head.appendChild(script);
   }
View Full Code Here

    String prepend = url.indexOf("?") != -1 ? "&" : "?";
    String u = url + prepend + "callback=" + transId + generateUrl(loadConfig);

    createCallback(this, transId);

    ScriptElement script = Document.get().createScriptElement();
    script.setId(transId);
    script.setType("text/javascript");
    head.appendChild(script);

    script.setSrc(u);
  }
View Full Code Here

     */
    public static void injectResourceScriptAsFile(String filename)
    {
        if (!scriptIsInjected.contains(filename))
        {
            ScriptElement link = Document.get().createScriptElement();
            link.setAttribute("language", "javascript");
            link.setText(filename);
            getHead().appendChild(link);

            scriptIsInjected.add(filename);
        }
    }
View Full Code Here

public class CustomAnalyticsImpl implements GoogleAnalytics {
  @Override
  public void init(String userAccount) {
    Element firstScript = Document.get().getElementsByTagName("script").getItem(0);

    ScriptElement config = Document.get().createScriptElement(
        "var _gaq = _gaq || [];_gaq.push(['_setAccount', '" + userAccount
            + "']);_gaq.push(['_trackPageview']);");

    firstScript.getParentNode().insertBefore(config, firstScript);

    ScriptElement script = Document.get().createScriptElement();

    // Add the google analytics script.
    script.setSrc(("https:".equals(Window.Location.getProtocol())
        ? "https://ssl" : "http://www") + ".google-analytics.com/ga.js");
    script.setType("text/javascript");
    script.setAttribute("async", "true");

    firstScript.getParentNode().insertBefore(script, firstScript);
  }
View Full Code Here

 
  public static void init(String userAccount) {

    Element firstScript = Document.get().getElementsByTagName("script").getItem(0);

    ScriptElement config = Document.get().createScriptElement(
        "var _gaq = _gaq || [];_gaq.push(['_setAccount', '" + userAccount + "']);_gaq.push(['_trackPageview']);");

    firstScript.getParentNode().insertBefore(config, firstScript);

    ScriptElement script = Document.get().createScriptElement();

    // Add the google analytics script.
    script.setSrc(("https:".equals(Window.Location.getProtocol()) ? "https://ssl" : "http://www") + ".google-analytics.com/ga.js");
    script.setType("text/javascript");
    script.setAttribute("async", "true");

    firstScript.getParentNode().insertBefore(script, firstScript);
  }
View Full Code Here

  private static boolean isScriptLoaded;
 
  @Override
  public void init(CanvasElement element, int width, int height) {
    if (!isScriptLoaded) {
      ScriptElement scriptElem = Document.get().createScriptElement();
      scriptElem.setType("text/javascript");
      scriptElem.setSrc(GWT.getModuleBaseURL() + "excanvas.js");
      Document.get().appendChild(scriptElem);
      isScriptLoaded = true;
    }
    initExcanvas(element);
    setWidth(element, width);
View Full Code Here

      } else {
        src = "http://www.google-analytics.com/ga.js";
      }

      Document doc = Document.get();
      ScriptElement script = doc.createScriptElement();
      script.setSrc(src);
      script.setType("text/javascript");
      doc.getBody().appendChild(script);

      return false;
    }
View Full Code Here

    @Override
    public void init(String userAccount) {
        Element firstScript = Document.get().getElementsByTagName("script").getItem(
                0);

        ScriptElement config = Document.get().createScriptElement(
                "var _gaq = _gaq || [];_gaq.push(['_setAccount', '" + userAccount
                        + "']);_gaq.push(['_trackPageview']);");

        firstScript.getParentNode().insertBefore(config, firstScript);

        ScriptElement script = Document.get().createScriptElement();

        // Add the google analytics script.
        script.setSrc(("https:".equals(Window.Location.getProtocol())
                ? "https://ssl" : "http://www") + ".google-analytics.com/ga.js");
        script.setType("text/javascript");
        script.setAttribute("async", "true");

        firstScript.getParentNode().insertBefore(script, firstScript);
    }
View Full Code Here

    if (failureCallbackParam != null) {
      uri.append("&");
      uri.append(failureCallbackParam).append("=").append(prefix).append(
          ".onFailure");
    }
    ScriptElement script = Document.get().createScriptElement();
    script.setType("text/javascript");
    script.setId(callbackId);
    script.setSrc(uri.toString());
    timer = new Timer() {
      @Override
      public void run() {
        onFailure(new TimeoutException("Timeout while calling " + baseUri));
      }
View Full Code Here

TOP

Related Classes of com.google.gwt.dom.client.ScriptElement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.