jquery-ui dialog does not show HTML server error message - javascript

I want to show a html page which is saved in a string with jquery-ui dialog. Unfortunately no dialog opens.
This is my code:
$(failedRequest.responseText).dialog();
The error message in the js console says:
Uncaught TypeError: Cannot read property 'display' of undefined
I also tried
$('<html><body><h1>A title</h1>And some text.</body></html>').dialog();
which works fine.
I assume there's something in the HTML code which causes .dialog() to fail. This is the compelente HTML code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
<title>EAI Configuration Web :: Status page</title>
<link href="/EAIConfig/styles/design.css" rel="stylesheet" type="text/css" media="all" />
<link href="/EAIConfig/styles/print.css" rel="stylesheet" type="text/css" media="print" />
<link rel="shortcut icon" type="image/x-icon" href="/EAIConfig/img/favicon.ico" />
<link rel="icon" type="image/x-icon" href="/EAIConfig/img/favicon.ico" />
<script type="text/javascript">
function onChangeAutoSessionClose() {
var checked = document.getElementById('autoSessionClose').checked;
$.post("autoSessionClose.action", {autoSessionClose: checked});
};
</script>
</head>
<body id="page-home">
<div id="maincontainer">
<div id="header">
<div class="headerTop">
<div class="logo">
<img src="/EAIConfig/img/galenicaLogo.gif"
title="" />
</div>
<div id="blockMainPopup" style="float:right">
<form id="logout" name="logout" action="logout" method="post">
<a class="item" href="javascript:print()"><img
src="/EAIConfig/img/iconPrint.gif"
alt="Print Page" /> title.print</a>
login.as : ugxnbpluse
<input type="submit" id="logout_logout" name="action:logout" value=""/>
</form>
</div>
<div class="row"></div>
</div>
</div>
<div id="content">
<div class="leftcontent">
<br/>
<ul>
title.mappingDefinition
<li> title.mapping</li>
<li>
title.businessServiceDefinition</li>
<li> title.dataStoreEntity</li>
<li> title.valueConversion</li>
<li> title.conditionalValueConversion</li>
</ul>
<br/>
<ul>
title.messageTypeDefinition
<li>
title.taskMessageType</li>
<li> title.messageType</li>
<li> title.outputConfiguration</li>
<li> title.configurationHeader</li>
<li>
title.startTaskContent</li>
</ul>
<br/>
<ul>
title.administration
<li>
title.contractorDefinition
</li>
<li>
title.partnerGroupList
</li>
<li>
title.holidayCalendar
</li>
<li>
title.exportImport
</li>
<li>
title.lastChange
</li>
<li>
title.translation
</li>
</ul>
<br/>
<ul>
title.reports
<li>
title.reports.partner
</li>
</ul>
</div>
<div class="rightcontent">
<div id="pagetitle">
<h1>
title.eaiConfiguration
-
Status page
</h1>
<h2>
</h2>
</div>
<div class="row">
</div>
<br/><br/><br/>
<p style="font-size: 1.2em;font-weight: bold;margin: 1em 0px;">Internal Server Error</p>
<p>Internal Server Error</p>
<p>You can get technical details here.<br>
Please continue your visit at our home page.
</p>
</div>
</div>
</div>
</body>
</html>
Any ideas about how to get this HTML shown in a dialog?

Related

Make div disappear when list from drop down menu is selected

I made a dropdown menu when users are on iphone 6plus and lower and the drop down menu works fine but, when you click like "jobs or contact" it opens up but the drop down menu stays there. How do I make it "hide" after a list item is clicked in the iPhone 6plus width and lower. I have the drop down menu set with a toggle function so that might help understand it better.
Demo :
http://codepen.io/anon/pen/VpyNwa
Html
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://fonts.googleapis.com/css?family=Nunito:700" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Baloo" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Lobster" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css">
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
<link rel="stylesheet" type="text/css" href="magicstyle.css">
</head>
<body>
<!-- Section for Jobs Popup -->
<div id="top-bar">
<a id="burger-nav"></a>
<ul id="nav-menu" class="blah">
<li id="job" class="testAgain">Job</li>
<li id="contact" class="testAgain">Contact</li>
<li id="press" class="testAgain">Press</li>
<li id="legal" class="testAgain">Legal</li>
<li id="support" class="testAgain">Support</li>
</ul>
<!--<div id="nav-menu">
<span id="job">Jobs</span>
<span id="contact">Contact</span>
<span id="press">Press</span>
<span id="legal">Legal</span>
<span id="support">Support</span>
</div> -->
</div>
<div id="job-popup">
<div class="x-div1"><img class="x-icon1" id="fadeX1" src="web%20x%20icon%20white.png" alt="Text alternative when image is not available"></div>
<div id="job-content">
<h1 id="jobWords"></h1>
</div>
</div>
<!-- Section for Contact Popup -->
<div id="contact-popup">
<div class="x-div2"><img class="x-icon2" id="fadeX2" src="web%20x%20icon%20white.png"></div>
<div id="contact-content">
<h1 id="contactWords"></h1>
</div>
</div>
<!-- Section for Press Popu -->
<div id="press-popup">
<div class="x-div3"><img class="x-icon3" id="fadeX3" src="web%20x%20icon%20white.png"></div>
<div id="press-content">
<h1 id="pressWords"></h1>
</div>
</div>
<div id="legal-popup">
<div class="x-div4"><img class="x-icon4" id="fadeX4" src="web%20x%20icon%20white.png"></div>
<div id="legal-content">
<h1 id="legalWords"></h1>
</div>
</div>
<div id="support-popup">
<div class="x-div5"><img class="x-icon5" id="fadeX5" src="web%20x%20icon%20white.png"></div>
<div id="support-content">
<h1 id="supportWords"></h1>
</div>
</div>
<div id="container">
<div id="name-div">
<h1 id="name">Open Touch</h1>
</div>
<ul class="bubbles">
<li id="firstCircle"></li>
<li id="secondCircle"></li>
<li id="thirdCircle"></li>
<li id="fourthCircle"></li>
<li id="fifthCircle"></li>
<li id="sixthCircle"></li>
</ul>
</div>
</body>
Any help is appreciated
</html>
Try adding this in your JS:
$('.testAgain').click(function(){ $('.blah').removeClass('open') })

Ember Inspector Config not defined error

I'm trying to build the sample application, i'm getting this error, Uncaught ReferenceError: EMBER_INSPECTOR_CONFIG is not defined, Can someone tell me how to define EMBER_INSPECTOR_CONFIG ??
This is my index.html fle
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Ember.js • TodoMVC</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<script type="text/x-handlebars" data-template-name="todos">
<section id="todoapp">
<header id="header">
<h1>todos</h1>
<input type="text" id="new-todo" placeholder="What needs to be done?" />
</header>
<section id="main">
<ul id="todo-list">
<li class="completed">
<input type="checkbox" class="toggle">
<label>Learn Ember.js</label><button class="destroy"></button>
</li>
<li>
<input type="checkbox" class="toggle">
<label>...</label><button class="destroy"></button>
</li>
<li>
<input type="checkbox" class="toggle">
<label>Profit!</label><button class="destroy"></button>
</li>
</ul>
<input type="checkbox" id="toggle-all">
</section>
<footer id="footer">
<span id="todo-count">
<strong>2</strong> todos left
</span>
<ul id="filters">
<li>
All
</li>
<li>
Active
</li>
<li>
Completed
</li>
</ul>
<button id="clear-completed">
Clear completed (1)
</button>
</footer>
</section>
<footer id="info">
<p>Double-click to edit a todo</p>
</footer>
</script>
<script src="js/libs/jquery-1.11.1.min.js"></script>
<script src="js/libs/handlebars-v1.3.0.js"></script>
<script src="js/libs/ember.js"></script>
<script src="js/libs/ember-data.js"></script>
<script src="js/application.js"></script>
<script src="js/router.js"></script>
</body>
</html>
Update December 24 2014:
The Ember Inspector has been updated. If you encounter this issue you're likely still using an old version for some reason.
This is a bug in the Ember Inspector that has been fixed here (but not yet released).
It should not affect your application, and only shows up if the Ember Inspector is active and the content script is delayed.
You can either ignore the error when it happens and wait for the next Ember Inspector version to be released (which is soon), or set window.EMBER_INSPECTOR_CONFIG = null temporarily.

Ember.js todo app handlebars template issues

I'm very new to Ember and am trying to follow the ToDo app tutorial. However, I am having a hard time generating a handlebar script in my index.html file. Here is what the index file looks pre-handlebars script
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Ember.js • TodoMVC</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<section>
<section id="todoapp">
<header id="header">
<h1>todos</h1>
<input type="text" id="new-todo" placeholder="What needs to be done?" />
</header>
<section id="main">
<ul id="todo-list">
<li class="completed">
<input type="checkbox" class="toggle">
<label>Learn Ember.js</label><button class="destroy"></button>
</li>
<li>
<input type="checkbox" class="toggle">
<label>...</label><button class="destroy"></button>
</li>
<li>
<input type="checkbox" class="toggle">
<label>Profit!</label><button class="destroy"></button>
</li>
</ul>
<input type="checkbox" id="toggle-all">
</section>
<footer id="footer">
<span id="todo-count">
<strong>2</strong> todos left
</span>
<ul id="filters">
<li>
All
</li>
<li>
Active
</li>
<li>
Completed
</li>
</ul>
<button id="clear-completed">
Clear completed (1)
</button>
</footer>
</section>
<footer id="info">
<p>Double-click to edit a todo</p>
</footer>
<script src="js/libs/jquery-1.10.2.min.js"></script>
<script src="js/libs/handlebars-1.1.2.js"></script>
<script src="js/libs/ember-1.4.0.js"></script>
<script src="js/libs/ember-data.js"></script>
<script src="js/application.js"></script>
<script src="js/router.js"></script>
</body>
</html>
However, when I wrap the handlebars script tag within the body element, the other HTML elements are not rendered properly. The code doesn't run in my browser and I suspect the script is missing a closing element somewhere. I'm not sure where. Does anyone have any pointers. Much appreciated and thank you in advance.
<script type="text/x-handlebars" data-template-name="todos">
<section>
<section id="todoapp">
<header id="header">
<h1>todos</h1>
<input type="text" id="new-todo" placeholder="What needs to be done?" />
</header>
<section id="main">
<ul id="todo-list">
<li class="completed">
<input type="checkbox" class="toggle">
<label>Learn Ember.js</label><button class="destroy"></button>
</li>
<li>
<input type="checkbox" class="toggle">
<label>...</label><button class="destroy"></button>
</li>
<li>
<input type="checkbox" class="toggle">
<label>Profit!</label><button class="destroy"></button>
</li>
</ul>
<input type="checkbox" id="toggle-all">
</section>
<footer id="footer">
<span id="todo-count">
<strong>2</strong> todos left
</span>
<ul id="filters">
<li>
All
</li>
<li>
Active
</li>
<li>
Completed
</li>
</ul>
<button id="clear-completed">
Clear completed (1)
</button>
</footer>
</section>
<footer id="info">
<p>Double-click to edit a todo</p>
</footer>
</script>
I'm not completely sure what the issue is, but I would check that all of your js files are being properly loaded. I actually tried the ToDo demo from here that used JS Bin and I didn't see that it was working. However, after taking that code and placing into a jsfiddle where the sources are loaded in the <head> tag, it actually worked.
Here's a link to the jsfiddle and here a link to the live version. I would inspect the output on the second link and see what the differences are between that and your code.
Hope you get your question resolved!
I faced the same issue while working through the Tutorial.
The trick is in the order of the script includes. Make sure that the framework dependencies are included first and then the application.js and finally the router.js. See below:
<!-- ... Ember.js and other javascript dependencies ... -->
<script src="js/libs/jquery-1.10.2.min.js"></script>
<script src="js/libs/handlebars-1.0.0.js"></script>
<script src="js/libs/ember.js"></script>
<script src="js/libs/ember-data.js"></script>
<script src="js/application.js"></script>
<script src="js/router.js"></script>
You can't write html on < script > element !!

Why isn't Foundation 4 Orbit working for me?

I'm not sure as to why my implementation is not working. I have followed the documentation on the foundation 4 site but can not figure out why it's not working. All that shows up are the cursor dots that change the position of the pictures in the Orbit. Also, I have the correct css/html/js folder paths.
Here's what my mark up looks like:
<!DOCTYPE html>
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title> Foundation 4</title>
<!-- If you are using CSS version, only link these 2 files, you may add app.css to use for your overrides if you like. -->
<link rel="stylesheet" href="foundation-4/css/normalize.css" />
<link rel="stylesheet" href="foundation-4/css/foundation.css" />
<script src="foundation-4/js/vendor/custom.modernizr.js"></script>
</head>
<body>
<!-- body content here -->
<nav class="top-bar">
<ul class="left">
<li class="name"><font color="white">Va</font></li>
</ul>
<ul class="right">
<li class="name"><font color="white">Home</font></li>
</ul>
</nav>
<br>
<!-- ======================== ORBIT===================== -->
<div class="orbit-container">
<ul data-orbit="" class="orbit-slides-container">
<li>
<img src="3.jpg">
<div class="orbit-caption">IMAGE 3</div>
</li>
<li class="active">
<img src="1.jpg">
<div class="orbit-caption">IMAGE 1</div>
</li>
<li>
<img src="2.jpg">
<div class="orbit-caption">IMAGE 2</div>
</li>
<li>
<img src="3.jpg">
<div class="orbit-caption">IMAGE 3</div>
</li>
<li>
<img src="1.jpg">
<div class="orbit-caption">IMAGE 1</div>
</li>
</ul>
<!-- Prev/Next Arrows -->
Prev<span></span>
Next<span></span>
<!-- Slide Numbers -->
<div class="orbit-slide-number">
<span>1</span> of <span>3</span>
</div>
<!-- Timer and Play/Pause Button -->
<div class="orbit-timer">
<span></span>
<div class="orbit-progress" style="width: 100%; -webkit-transition: width 10s linear;"></div>
</div>
</div>
<!-- Orbit Bullet Slide Indicator -->
<ol class="orbit-bullets">
<li data-orbit-slide-number="1"></li>
<li data-orbit-slide-number="2" class="active"></li>
<li data-orbit-slide-number="3"></li>
</ol>
<!-- =======ORBIT END======= -->
<script>
document.write('<script src=foundation-4/js/vendor/'
+ ('__proto__' in {} ? 'zepto' : 'jquery')
+ '.js><\/script>');
</script>
<script>
document.write('<script src=' +
('__proto__' in {} ? 'foundation-4/js/vendor/zepto' : 'foundation-4/js/vendor/jquery') +
'.js><\/script>')
</script>
<script src="js/foundation/foundation.js"></script>
<script src="js/foundation/foundation.orbit.js"></script>
<script src="js/foundation/foundation.alerts.js"></script>
<script src="js/foundation/foundation.clearing.js"></script>
<script src="js/foundation/foundation.cookie.js"></script>
<script src="js/foundation/foundation.dropdown.js"></script>
<script src="js/foundation/foundation.forms.js"></script>
<script src="js/foundation/foundation.joyride.js"></script>
<script src="js/foundation/foundation.magellan.js"></script>
<script src="js/foundation/foundation.orbit.js"></script>
<script src="js/foundation/foundation.placeholder.js"></script>
<script src="js/foundation/foundation.reveal.js"></script>
<script src="js/foundation/foundation.section.js"></script>
<script src="js/foundation/foundation.tooltips.js"></script>
<script src="js/foundation/foundation.topbar.js"></script>
<script src="js/foundation/foundation.interchange.js"></script>
<script>
$(document).foundation();
</script>
</body>
</html>
Also, here is a screen shot of the errors I am getting in google chrome.
http://s1228.photobucket.com/user/Ebadly/media/random/ScreenShot2013-11-15at112428AM_zpsdfc35907.png.html
EDIT: THE FOUNDATION DOUMENTATION CONTAINS
<ul data-orbit="" class="orbit-slides-container">
REMOVE: ="" class="orbit-slides-container" It did the TRICK FOR ME: SO it becomes:
<ul data-orbit>
"Uncaught TypeError: Object # this is because jQuery has not loaded. Download jQuery from here http://jquery.com/download/
Link this jQuery file to your website
Even if the jQuery file is linked properly make sure it is loaded in the
<head></head> tags before loading the foundation javascript files
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title> Foundation 4</title>
<!-- If you are using CSS version, only link these 2 files, you may add app.css to use for your overrides if you like. -->
<link rel="stylesheet" href="foundation-4/css/normalize.css" />
<link rel="stylesheet" href="foundation-4/css/foundation.css" />
<script src="LINKTO JQUERY JS FILE"></script>
<script src="foundation-4/js/vendor/custom.modernizr.js"></script>
</head>
EDIT:
<div class="row">
<div class="orbit-container">
<ul data-orbit="" class="orbit-slides-container">
<li>
<img src="3.jpg">
<div class="orbit-caption">IMAGE 3</div>
</li>
<li class="active">
<img src="1.jpg">
<div class="orbit-caption">IMAGE 1</div>
</li>
<li>
<img src="2.jpg">
<div class="orbit-caption">IMAGE 2</div>
</li>
<li>
<img src="3.jpg">
<div class="orbit-caption">IMAGE 3</div>
</li>
<li>
<img src="1.jpg">
<div class="orbit-caption">IMAGE 1</div>
</li>
</ul>
</div>
</div>
EDIT: TRY THIS
<div class="large-12 columns">
<div class="orbit-container">
<ul data-orbit>
<li data-orbit-slide="headline-1">
<h2>Headline 1</h2>
<h3>Subheadline</h3>
<p>Pellentesque habitant morbi tristique senectus.</p>
</li>
<li data-orbit-slide="headline-2">
<h2>Headline 2</h2>
<h3>Subheadline</h3>
<p>Pellentesque habitant morbi tristique senectus.</p>
</li>
</ul>
</div>
</div>
It's not going to work because there are AJAX calls being made to get the scripts. You're going to have to use something like USBWebServer if you're going to develop/test locally.

Bind Form from javascript Play framework

Is there a way to use this code:
Form<StatusSolicitacao> status = form(StatusSolicitacao.class).bindFromRequest();
But the data coming from a javascript?
--- More information ---
First i show the list:
<div id="backtabela">
<div id="tabela">
<table>
<tr><td>Cadastrar Status</td></tr>
<tr>
<td id="cabecalho">Descrição</td>
<td id="cabecalho">Acoes</td>
</tr>
#for(status <- lista){
<tr>
<td>#status.getDescricao()</td>
<td><img src="#routes.Assets.at("img/edit.png")" alt="" title="Editar"/>
<img src="#routes.Assets.at("img/erase.png")" alt="" title="Remover"/>
</td>
</tr>
}
</table>
</div>
</div>
Then i click on the Cadastrar Status to register a new data.
The form:
#(status: Form[StatusSolicitacao])
#import helper._
#implicitFieldConstructor = #{ FieldConstructor(formPattern.f) }
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head>
<fieldset id="fieldset">
<legend>Novo Status</legend>
<div id="form">
<br/><br/><br/><br/><br/>
#form(routes.StatusController.cadastrarStatus()) {
<br/><br/><br/><br/><br/>
#inputText(status("descricao"), '_label -> "Descrição", '_help->"")
<div class="actions">
<input type="submit" value="Cadastrar" class="btn primary" id="botao">
</div>
</div>
</fieldset>
Cancelar
}
Note: All this content is inside the div nova in this html:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Solicitação Compra</title>
<link rel="stylesheet" media="screen" href="#routes.Assets.at("css/geral.css")">
<link rel="shortcut icon" type="img/png" href="#routes.Assets.at("img/favicon.png")">
<script src="#routes.Assets.at("javascripts/jquery-1.9.0.min.js")" type="text/javascript"></script>
<script src="#routes.Assets.at("javascripts/init.js")" type="text/javascript"></script>
</head>
<body>
<div id="geral-flow">
<div id="topo">
<div id="logo" style="display:none;">
<img src="#routes.Assets.at("img/logotipo-pequeno.png")" alt="titulo" id="tituloPequeno"/>
</div>
<div id="acessos">
<div id="pesquisa">
<input type="text" name="search" id="search" value="Pesquisa"
onfocus="this.value=''" onblur="this.value='Pesquisa'"></input>
<ul></ul>
</div>
<div id="acessoRapido" >
</div>
</div>
</div>
<div id="conteudo">
<div id="titulo">
<ul>
<li style="background-position:-2px -107px;"><h2>Solicitações</h2></li>
</ul>
</div>
<div id="separador"></div>
<div id="menu">
<ul>
<li class="solicitacao">Solicitaçoes<br /></li>
<li class="departamento">Departamentos<br /></li>
<li class="responsavel">Responsavel<br /></li>
<li class="status">Status<br /></li>
</ul>
</div>
<div id="nova"></div>
<div class="clear"></div>
</div>
</div>
</body>
</html>
but when I save my new record on the bench in the back that html does not appear.
javaScript or not basically its a post request if your name attributes coincide the StatusSolicitacao attributes i believe it will work
else just use the following String attribute = Form.form().bindFromRequest().get("attribute");

Categories