Check documentation for the latest version of dhtmlxSuite attachURL DHTMLX Docs

attachURL

attaches the specified URL to a tab

void attachURL(string url, [boolean ajax,boolean|object postData] );
urlstringURL to attach
ajaxboolean(optional) if set to true, the URL will be loaded by AJAX (async GET), false by default
postDataboolean|object(optional) performs POST request (true for a simple post or an object with params)

Example

/* iframe */
// GET
myTabbar.tabs(id).attachURL("page.html");
// POST
myTabbar.tabs(id).attachURL("page.html", null, true);
// POST with params
myTabbar.tabs(id).attachURL("page.html", null, {fname: "Mike", hobby: "fishing"});
 
/* by ajax */
// GET
myTabbar.tabs(id).attachURL("page.html", true);
// POST
myTabbar.tabs(id).attachURL("page.html", true, true);
// POST with params
myTabbar.tabs(id).attachURL("page.html", true, {fname: "Mike", hobby: "fishing"});

Details

important notes:

  • to prevent caching in some browsers, an extra param like "dhxr0123456789" will be added
    (to disable the extra param set dhx.ajax.cache = true, please check details here)
  • loading is async, so to proceed with content, you need onContentLoaded event
  • learn how to control attached content here
Change log

postData param and the ability to perform POST request are added in version 4.0

Back to top