jQuery refuses to load my dynamic content in IE6. All in FireFox & Safari works fine. Only IE6 is being a pain. When I try the a html with
<p>Hello World</p>
that works. Properly. But when loading a PHP it doesn't work!
As you can see it's doing multiple things.
<script type="text/javascript">
// When the document is ready set up our sortable with it's inherant function(s)
$(document).ready(function() {
// Sort list & amend in database
function sortTableMenuAndReload() {
var order = $('#menuList').sortable('serialize');
$.post("PLUGINS/SortableMenu/process-sortable.php",order);
$("#menuList").load("PLUGINS/SortableMenu/sortableMenu_ajax.php");
}
function sortTableOrder() {
var order = $('#menuList').sortable('serialize');
$.post("PLUGINS/SortableMenu/process-sortable.php",order);
}
function sortTableOrderAndRemove(removeID) {
$('#listItem_'+removeID).remove();
var order = $('#menuList').sortable('serialize');
$.post("PLUGINS/SortableMenu/process-sortable.php",order);
$("#menuList").load("PLUGINS/SortableMenu/sortableMenu_ajax.php");
}
$("#menuList > li > .remove").live('click', function () {
var removeID = $(this).attr('id');
$.ajax({
type: 'post',
url: 'PLUGINS/SortableMenu/removeLine.php',
data: 'id='+removeID,
success: sortTableOrderAndRemove(removeID)
});
});
$("#menuList > li > .publish").live('click', function () {
var publishID = $(this).attr('id');
$.ajax({
type: 'post',
url: 'PLUGINS/SortableMenu/publishLine.php',
data: 'id='+publishID,
success: sortTableOrder
});
});
$('#new_documents > li').draggable({
addClasses: false,
helper:'clone',
connectToSortable:'#menuList'
});
$("#menuList").droppable({
addClasses: false,
drop: function() {
var clone = $("#menuList > li#newArticleTYPE1");
$(clone).attr("id","listItem_newArticleTYPE1");
}
});
$("#menuList").sortable({
opacity: 0.6,
handle : '.handle, .remove',
update : sortTableMenuAndReload
});
});
</script>
hye im newbie here..
im looking for a hidden information in a source code..in the page, the information is visible but when i try to find it in the source code, the information is not there..but behind the code it has [script type = "text/javascript].. i believe the information i need is in between the javascript..my question is, how to get the information between the javascript?..it has the innerHtml code between the javascript..any one can help?
I have some legacy html that needs to work on old and new browsers (down to IE7) as well as the iPad. The iPad is the biggest issues because of how text selection is handled. On a page there is a textarea as well as some text instructions. The instructions are in a <div> and the user needs to be able to select the instructions.
The problem is that once focus is placed in the textarea, the user cannot subsequently select the text instructions in the <div>. This is because the text cannot receive focus.
According to the Safari Web Content Guide: Handling Events (especially, "Making Elements Clickable"), you can add a onclick event handler to the div you want to receive focus.
This solution works (although it is not ideal) in iOS 6x but it does not work in iOS 5x.
Does anyone have a suggestion that minimizes changes to our existing code and produces consistant user interaction.
Here is sample code that shows the problem.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script src="http://code.jquery.com/jquery-1.8.2.js"></script>
<!--
Resources:
Safari Web Content Guide: Handling Events (especially, "Making Elements Clickable")
http://developer.apple.com/library/safari/#documentation/appleapplications/reference/safariwebcontent/HandlingEvents/HandlingEvents.html#//apple_ref/doc/uid/TP40006511-SW1
-->
</head>
<body>
<div style="width:550">
<div onclick='function() { void(0); }'>
<p>On the iPad, I want to be able to select this text after the textarea has had focus.</p>
</div>
<textarea rows="20" cols="80">After focus is in the textarea, can you select the text above?</textarea>
</div>
</body>
</html>
I cant able to get this jquery statement to work on page load but it works once when i refresh F5 the page.....
<script type="text/javascript">
var itemsPerPage = 5;
$(document).ready(function() {
getRecordspage(0, itemsPerPage);
var maxvalues = $("#HfId").val();
alert(maxvalues);
$(".pager").pagination(maxvalues, {
//my syntax
});
});
</script>
On the initial pageload alert(maxvalues); is nothing... But when i refresh it shows the value of maxvalues which is in the hidden field HfId because it is assigned in the function getRecordspage....
Why this strange behaviour.... Any suggestion...
EDIT:
function getRecordspage(curPage) {
$.ajax({
type: "POST",
url: "Default.aspx/GetRecords",
data: "{'currentPage':" + (curPage + 1) + ",'pagesize':5}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(jsonObj) {
$("#ResultsDiv").empty();
$("#HfId").val("");
var strarr = jsonObj.d.split('##');
var jsob = jQuery.parseJSON(strarr[0]);
var divs = '';
$.each(jsob.Table, function(i, employee) {
divs += '<div class="resultsdiv"><br /><span class="resultName">' + employee.Emp_Name + '</span><span class="resultfields" style="padding-left:100px;">Category :</span> <span class="resultfieldvalues">' + employee.Desig_Name + '</span><br /><br /><span id="SalaryBasis" class="resultfields">Salary Basis :</span> <span class="resultfieldvalues">' + employee.SalaryBasis + '</span><span class="resultfields" style="padding-left:25px;">Salary :</span> <span class="resultfieldvalues">' + employee.FixedSalary + '</span><span style="font-size:110%;font-weight:bolder;padding-left:25px;">Address :</span> <span class="resultfieldvalues">' + employee.Address + '</span></div>';
});
$("#ResultsDiv").append(divs);
$(".resultsdiv:even").addClass("resultseven");
$(".resultsdiv").hover(function() {
$(this).addClass("resultshover");
}, function() {
$(this).removeClass("resultshover");
});
$("#HfId").val(strarr[1]);
}
});
}
I would like to convert this /bin/sh syntax into a widely compatible Windows batch script:
host=`hostname`
echo ${host}
How to do this so that it'll work on any Windows Vista, Windows XP, and Windows 2000 machine?
To clarify: I would then like to go on in the program and use the hostname as stored in the variable host. In other words, the larger goal of the program is not to simply echo the hostname.
is there an activerecord (any similar SQL-wrapper) for python? which is good for:
used in a server-side python script
light-weight
supports MySQL
what I need to do:
insert (filename, file size, file md5, the file itself) into (string, int, string, BLOB) columns
if the same file (checksum + filename) does not exist in db
thx
Hello, we're facing a problem now. We have a pretty big page with a loooong inline script, which does all the work. We now want to obfuscate it and use it as a separate .js file. But the problem is that we have paths which are generated by Url helper (Url.Content()). So what is the best way to separate js file from the page and not using hard-coded path strings?
I have a map in perl which has been dumped into from some legacy code the name of the key has now changed from simply reqHdrs to reqHdrs.bla
$rec->{reqHdrs.bla}
My problem is now I cant seem to access this field from the map any ideas ?
The following is my error
Download Script Output: Bareword "reqHdrs" not allowed while "strict subs" in use
Hello,
I am looking for a way to import BRE generated policy with its' vocabularies into BizTalk application from a command line (in order to script it) leveraging BtsTask command line tool.
I've searched around, and couldn't find a firm answer.
Thank you.
We have link to some page (with html code), that page have one img, which attributes title and alt are equal.
Script must open link, grab the src attribute of img which title=alt, and throw the value into some variable.
How to do it?
Thanks.
I have this code below and as a test i have that alert below.
When i open firebug and i put a break point on the "debugger" and it doesn't fire but the alert does get called as a i get a alert popup.
Any idea why i can't capture this breakpoint ?
<script type="text/javascript">
$(function() {
$("#tabs").tabs({
selected: 0,
load: function(event, ui) {
debugger;
alert(ui.panel.id);
}
});
Hi all,
I am learning how to use JQuery to help check data availability.
To start with it, I wrote a few lines of codes using cakePHP.
I have written a function in a Controller for checking data input, and the URL is like this:
http://www.mywebsite.com/controllers/action/avariable
I was trying to pass the value in a Input TextBox field using the JQuery Ajax to the URL above,but I don't know why it is not working in passing a variable to the Controller's action. Could you help me out please?
<Script language="javascript">
//<!--
$(document).ready(function(){
$(document).change(function() {
var usr = $("#data\\[User\\]\\[name\\]").val();
if(usr.length >= 3){
$("#username").append('<span><img align="absmiddle" src="loader.gif" />Checking</span>');
$.ajax({
type: "POST",
url: "http://www.mywebsite.com/controllers/action/",
data: usr,
success: function(msg){
if(msg == 'OK')
{
$("#username").append('<span><img align="absmiddle" src="accepted.png"/></span>');
}
else
{
$("#username").append('<span>'+msg+'</span>');
}
}
});
}
else
{
$("#username").append('<span>The username should have at least 3 characters.</span>');
}
});
});
//-->
</Script>
<form name="adduser" id="adduser" method="post" action="/controllers/action2">
<table border=0 width="100%">
<tr>
<td>Username</td>
<td>
<div id="username">
<input type=text name="data[User][name]" id="data[User][name]">
</div>
</td>
</tr>
<tr>
<td>
<input type="submit" value="Send">
</td>
</tr>
</table>
</form>
I need a script to identify the files opened a particular process on linux
To identify fd :
>cd /proc/<PID>/fd; ls |wc –l
I expect to see a list of numbers which is the list of files descriptors' number using in the process. Please show me how to see all the files using in that process.
Thanks.
[revised]
I'm creating a TreePanel in ExtJs that is loading its children from a JSON file. I'm having trouble adding a click action to the nodes. I'm not sure whether it's added in the script creating the tree, or if its added as a property in the JSON, and if so, what the syntax would be. Any help would be appreciated! Please provide an example if possible.
The reason I ask, is that it offers advanced functionality that almost no other lightbox-esque script offers. And that is an image caption that is pulled from a hidden span that follows the image.
This is important so that you can have html in your captions...
so...yeah...
I want to execute a script after the whole page has loaded, when it's complete.
The current way is:
window.onload=document.getElementById('loaded').value=1;
Which is not good, as some images are still in load, and the page has not completed loading truly. What I am doing wrong?
Consider a simple file upload system written in php. Customer has access only in admin panel.
(Not FTP). He may change folder option from 707 to 755 for security issue.
How can do this? Can we do this from upload script ? If yes is this a secure application?
Hi, I am using the Florance theme and it comes with a sliding image gallery using jquery and jcarousellite. Somehow it stopped working (it was ok 2 days) and error points to the script. The site in question is www.happystay.net
Please, i need some help. Thanks in advance.
Task: On click of li navigation filter show and hide content with a transitional fadein fade out.
Problem I'm just guessing and checking on where to place this fadein//fadeout transition. Furthermore, I feel like my code is too inefficiency because I'm using 4 conditional statements. Would stack lead me in creating a solution to improve the overall logic of this script so I can just make a pretty transition :c?
LIVE CODE
jQuery Script
$(document).ready(function () {
//attach a single click listener on li elements
$('li.navCenter').on('click', function () {
// get the id of the clicked li
var id = $(this).attr('id');
// match current id with string check then apply filter
if (id == 'printInteract') {
//reset all the boxes for muliple clicks
$(".box").find('.video, .print, .web').closest('.box').show();
$(".box").find('.web, .video').closest('.box').hide();
$(".box").find('.print').show();
}
if (id == 'webInteract') {
$(".box").find('.video, .print, .web').closest('.box').show();
$(".box").find('.print, .video').closest('.box').hide();
$(".box").find('.web').show();
}
if (id == 'videoInteract') {
$(".box").find('.video, .print, .web').closest('.box').show();
$(".box").find('.print, .web').closest('.box').hide()
$(".box").find('.video').show();
}
if (id == 'allInteract') {
$(".box").find('.video, .print, .web').closest('.box').show();
}
});
HTML Selected
<nav>
<ul class="navSpaces">
<li id="allInteract" class="navCenter">
<a id="activeAll" class="navBg" href="#"><div class="relativeCenter"><img src="asset/img/logo30px.png" /><h3>all</h3></div></a>
</li>
<li id="printInteract" class="navCenter">
<a id="activePrint" class="navBg" href="#"><div class="relativeCenter"><img src="asset/img/print.gif" /><h3>print</h3></div></a>
</li>
<li id="videoInteract" class="navCenter">
<a id="activeVideo" class="navBg" href="#"><div class="relativeCenter"><img src="asset/img/video.gif" /><h3>video</h3></div></a>
</li>
<li id="webInteract" class="navCenter">
<a id="activeWeb" class="navBg" href="#"><div class="relativeCenter"><img src="asset/img/web.gif" /><h3>web</h3></div></a>
</li>
</ul>
ps. Sorry for the newbie question
I have a site that plays a stream. I perform an AJAX call to the server once a person presses a button.
<input type="submit" class="play" data-type="<?php echo $result_cameras[$i]["camera_type"]; ?>" data-hash="<?php echo $result_cameras[$i]["camera_hash"]; ?>" value="<?php echo $result_cameras[$i]["camera_name"]; ?>">
This prints out a bunch of buttons that the user can select. This is processed by the following code:
<script>
$(document).ready(function(){
$(".play").click(function(){
var camerahash = $(this).data('hash');
var cameratype = $(this).data('type');
function doAjax(){
$.ajax({
url: 'index.php?option=streaming&task=playstream&id_hash=<?php echo $id_hash; ?>&camera_hash='+camerahash+'&format=raw',
success: function(data) {
if (data == 'Initializing...please wait')
{
$('#quote p').html(data);
setTimeout(doAjax, 2000);
}
else
{
if (cameratype == "WEBCAM" && data == 'Stream is ready...')
{
$('#quote p').html(data);
window.location = 'rtsp://<?php echo DEVSTREAMWEB; ?>/<?php echo $session_id;?>/'+camerahash;
}
else if (cameratype == "AXIS" && data == 'Stream is ready...')
{
$('#quote p').html(data);
window.location = 'rtsp://<?php echo DEVSTREAMIP; ?>/<?php echo $session_id;?>/'+camerahash;
}
else
{
$('#quote p').html(data);
}
}
}
});
}
doAjax();
});
});
</script>
The server returns the messages such as Stream is ready.... My problem is that everything is working great except on additional button clicks. Specifically when they get success (video plays) and they exit back out, they don't get any other messages if they click another button. It is as if the click event is not triggered. Do I need to be doing something to the click handler to respond?
I want to be able to download a page and all of its associated resources (images, style sheets, script files, etc) using Python. I am (somewhat) familiar with urllib2 and know how to download individual urls, but before I go and start hacking at BeautifulSoup + urllib2 I wanted to be sure that there wasn't already a Python equivalent to "wget --page-requisites http://www.google.com".
Specifically I am interested in gathering statistical information about how long it takes to download an entire web page, including all resources.
Thanks
Mark
Hello,
I used use Google’s slick interface to get my mail and It’s always going to be here:
https://mail.google.com/a/yourdomainhere.com
I want to write python script that send mail so i failed to configure server settings
smtp = smtplib.SMTP('what is mail server will be?', what is the port)
smtp.login('[email protected]', 'pass')
Please could any one help me ??
Thanks