{"id":148,"date":"2013-11-26T12:45:46","date_gmt":"2013-11-26T12:45:46","guid":{"rendered":"http:\/\/wservice.solerpalau.com\/?page_id=148"},"modified":"2014-06-02T08:05:55","modified_gmt":"2014-06-02T08:05:55","slug":"getting-started-with-the-sdk-for-javascript","status":"publish","type":"page","link":"https:\/\/wservice.solerpalau.com\/en\/getting-started\/getting-started-with-the-sdk-for-javascript\/","title":{"rendered":"Getting started with the SDK for Javascript"},"content":{"rendered":"<h3 id=\"cliente-javascript\">Cliente Javascript<\/h3>\n<p>In the javascript client the content will be load on the client machine. The request load the content that are configured in the params of the request.<\/p>\n<p><button onclick=\"window.open('\/SP_API\/js\/sp_api.js');\">Download Javascript SDK<\/button><\/p>\n<h4>Install<\/h4>\n<p>For proper operation will be essential load js libraries, together with jquery library and css style sheet provided from S&amp;P.<\/p>\n<pre><code>\r\n&lt;link href=\"\/SP_API\/style.css\" rel=\"stylesheet\" type=\"text\/css\" \/&gt;\r\n&lt;script type=\"text\/javascript\" src=\"\/\/ajax.googleapis.com\/ajax\/libs\/jquery\/1.9.1\/jquery.min.js\"&gt;&lt;\/script&gt;\r\n&lt;script type=\"text\/javascript\" src=\"\/SP_API\/js\/sp_api.js\"&gt;&lt;\/script&gt;\r\n<\/code><\/pre>\n<p>Then we will tell the API to charge content.<\/p>\n<h5>Params<\/h5>\n<p><strong>accountID<\/strong><br \/>\n(string) (required) The user ID provided by S&#038;P<\/p>\n<p><strong>navOptions<\/strong><br \/>\n(array) (required) Array of values \u200b\u200bthat specify the required language and menu items.<\/p>\n<h5>navOptions params<\/h5>\n<ul>\n<li><strong>ISOlanguage<\/strong> &#8211; (string) Language in ISO 639-1.<\/li>\n<li><strong>menuItems<\/strong> &#8211; (array) <strong>title<\/strong>: Title link. <strong>url<\/strong> Link relative to baseURL.<\/li>\n<li><strong>baseURL<\/strong> &#8211; (string) Web address where the links will be pointing.<\/li>\n<\/ul>\n<pre><code>\r\n&lt;script type=\"text\/javascript\"&gt;\r\n  SP_jsapi.init({\r\n    accountID:'easyvent',\r\n    navOptions:{\r\n      ISOlanguage:'es',\r\n        menuItems:[\r\n        {title: 'Inicio', url:''},\r\n        {title: 'Cat\u00e1logo', url:'\/catalogue'},\r\n        {title: 'Selectores', url:'\/selector'},\r\n        {title: 'Proyecto', url:'\/project'},\r\n        {title: 'Contacto', url:'\/contact'},\r\n        ],\r\n    baseURL: 'http:\/\/easyvent.solerpalau.com',\r\n    }\r\n});\r\n&lt;\/script&gt;\r\n<\/code><\/pre>\n<p>The required containers to be filled by javascript.<\/p>\n<pre><code>\r\n&lt;div class=\"wrapper\"&gt;\r\n&lt;div id=\"sp_header\"&gt;Loading header...&lt;\/div&gt;\r\n\r\n&lt;div id=\"sp_slider\"&gt;Loading slider...&lt;\/div&gt;\r\n\r\n&lt;div id=\"sp_footer\"&gt;Loading footer...&lt;\/div&gt;\r\n&lt;\/div&gt;\r\n<\/code><\/pre>\n<h5>Containers<\/h5>\n<p><strong>sp_header<\/strong> The id of the div containing the header that will be filled by S&amp;P.<br \/>\n<strong>sp_slider<\/strong> The id of the div containing the slider that will be filled by S&amp;P.<br \/>\n<strong>sp_footer<\/strong> The id of the div containing the header that will be filled by S&amp;P<br \/>\n<strong>sp_tooltipcookie<\/strong> The id of the div containing the tooltip cookie advice that will be filled by S&amp;P<br \/>\n<strong>sp_legal<\/strong> The id of the div containing the legal advice that will be filled by S&amp;P<\/p>\n<p>The containers &#8220;sp_header&#8221;, &#8220;sp_slider&#8221;, &#8220;sp_footer&#8221; and &#8220;sp_footer&#8221; must be presents to be filled by S&amp;P.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Cliente Javascript In the javascript client the content will be load on the client machine. The request load the content that are configured in the params of the request. Download Javascript SDK Install For proper operation will be essential load js libraries, together with jquery library and css style sheet provided from S&amp;P. &lt;link href=&#8221;\/SP_API\/style.css&#8221; &hellip; <a href=\"https:\/\/wservice.solerpalau.com\/en\/getting-started\/getting-started-with-the-sdk-for-javascript\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Getting started with the SDK for Javascript<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":150,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/wservice.solerpalau.com\/en\/wp-json\/wp\/v2\/pages\/148"}],"collection":[{"href":"https:\/\/wservice.solerpalau.com\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/wservice.solerpalau.com\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/wservice.solerpalau.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wservice.solerpalau.com\/en\/wp-json\/wp\/v2\/comments?post=148"}],"version-history":[{"count":13,"href":"https:\/\/wservice.solerpalau.com\/en\/wp-json\/wp\/v2\/pages\/148\/revisions"}],"predecessor-version":[{"id":576,"href":"https:\/\/wservice.solerpalau.com\/en\/wp-json\/wp\/v2\/pages\/148\/revisions\/576"}],"up":[{"embeddable":true,"href":"https:\/\/wservice.solerpalau.com\/en\/wp-json\/wp\/v2\/pages\/150"}],"wp:attachment":[{"href":"https:\/\/wservice.solerpalau.com\/en\/wp-json\/wp\/v2\/media?parent=148"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}