JQuery :: $.post Callback Broken In Safari In New Window.open()

Jul 9, 2009

I'm opening a new window with window.open() In the new window a file is loaded with the following post data function:

function ajaxPost(url,data){
$.post(url,data,
function(data){
alert(data)

[Code]....

If I call this function form within the new window everything is fine

- If I call it from the opener window the callback function is broken

- only in safari - ff works fine.

View 1 Replies


ADVERTISEMENT

Window.open Changes Focus In Safari?

Mar 24, 2011

I use a cookie to keep track of a particular window (using window.name), lets call this the main window. I use the window to distribute data returned from the server.

I use window.open("",mainWindowName) to get the reference to the main window object.

The problem is in nearly all browsers this works fine (focus stays on the current window), however in Safari, window.open also sets focus to that window (mainWindowName).

Of course I can reset focus back to the current window in Safari, but there is a quick flash of windows focus changing and it doesn't look good.

View 2 Replies View Related

JQuery :: JSON Callback Not Working In Safari / Opera And IE7

Jul 6, 2011

I am looking for a solution for many days: my callback - function works well in firefox 5, IE8, but not in safari, opera, IE7 etc. The function "checken" is not executed. There are no error messages in the debugger of safari or IE7.

var session_id = $.cookie("fe_typo_user");
function checken (nummer){
var elem = "#img" + nummer;
$(elem).attr('checked',true); }
var url = "refreshCheckboxes.php?id=" + session_id;
$.getJSON(url,function(data){
$.each(data.posts, function(i,data){
checken (data.number);
}); });

The response of the script:
{"posts": [{"number":"1325"},{"number":"1303"},{"number":"1302"}]}
html (example):
<input
type="checkbox"
id="img1325"
class="merkzettel"
name="merkzettel1325"
value="img_1325.jpg"
/>

You can test it here: [URL]. Activate some checkboxes, load another site and then go back to this site and the checkboxes you have selected, must be activated by the script.

View 9 Replies View Related

JQuery :: Post CallBack Not Firing In 1.4.2?

Apr 20, 2010

I've got an Ajax post that has been working fine with version 1.3.2 of jQuery, but when I tried it with version 1.4.2 it doesn't work. Specifically, the callback function is not firing when I define a variable equal to the function and then pass the post that variable.

Thus, in the following, if I call getCustList, the agent GetCustomerListSelection will run successfully on the server, but the ShowResult function will not fire. On the other hand, if I replace "ShowResult" in the post parameters with, say, "alert('You made it!')", then that works fine.

????
//////////////////////////////////////////////////////////////////////////////////////////////////////
// Define return function for AJAX
var ShowResult = function(result) {

[Code].....

View 2 Replies View Related

JQuery :: $.post Callback Data Is Empty

Nov 10, 2010

I have the following in the header if index.php:

Code JavaScript:
<script type="text/javascript" src="/jquery/jqueryui/js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="/jquery/jqueryui/js/jquery-ui-1.8.6.custom.min.js"></script>
<script type="text/javascript" src="/jquery/jqueryui/development-bundle/ui/jquery.ui.tabs.js"></script>
<script>

[Code]...

I then delete testFile.txt and click on 'Submit' without refreshing, and this time, it does NOT create testFile.txt - and hence, my guess is that it is not calling on functions.php, and of course, alert is empty as usual.

What I want to do is this: I want to be able to click on the Submit button - without refreshing the page - and return data from functions.php and display it within a div tag on index.php What am I doing wrong to get an empty alert?

View 5 Replies View Related

JQuery :: Determine Content Type In $.post Callback

Jul 6, 2009

How can I check if the content type is JSON or HTML here (server can return any)?

$.post(url, params, function(data) {
if (!isDataInJsonFormat(data, this)) {
editDialog.html(data);
return;

[Code]....

View 16 Replies View Related

JQuery :: Passing A Variable From A Post Callback Function?

Oct 23, 2010

I can't seem to get a variable declared from within a post callback, so that I could manipulate my script accordingly. I have delete.php, that deletes an id from a mysql db. If it fails, I want the script to stop and display the error. The .php script echos an "ok" if everything went fine, if not - it echos the error.var abort_error; // set the error variable

$.get("delete.php", { delete: $(this).parent().parent().parent().attr('id') },
function(data){
if(data != 'ok') {

[code]...

View 1 Replies View Related

JQuery :: $.post() Callback Executed No Data Passed

Jun 24, 2009

Here is my server side code:

Here is my javascript:

When i call alert(data), it says it is "undefined". i am new to jQuery, but this appears to mean that no data is being passed to the callback function even though i know the $.post() executed properly (the server side code is executing, and the other alert() tells me that it had a successful result and the callback is being made.

View 1 Replies View Related

JQuery :: Access Variable Inside Callback Function Of Post?

May 4, 2010

<script type="text/javascript" src="jquery-1.4.2.min.js"></script>
<script type="text/javascript">
var global_var = false;
function test_func() {
$.post("server.php", function(data){
alert("Data Loaded: " + data);

[Code]...

View 2 Replies View Related

$.post Not Sure If Callback Is Set Up Right

Oct 17, 2009

The following function runs on form submit. The code appears to process correctly, the create.php file does it's job, but I'm directed to the create.php page and stay there, so the callback function never runs.. What do I have to change to get create.php to process 'behind the scene', and to stay on the original web page, instead of being redirected to create.php?

Code JavaScript:

View 2 Replies View Related

JQuery :: Ajax Post Not Working In Firefox And Safari

Oct 22, 2010

I am doing simple Jquery ajax post to php and I am very new to three languages.[code]...

View 1 Replies View Related

JQuery :: Ajax Post Not Working On Mac - Safari And Firefox

Mar 4, 2011

My website has a JQuery dialog with a textarea where the user can type a text and submit. The submit is an ajax request to the server.

This is the code:

I can see the request on Firebug, so I added and error_log to my code.

The ajax request works perfectly on Firefox, Chrome and IE on PCs, but it does not work on Mac.

View 5 Replies View Related

JQuery :: Safari 3.2.1 And $.ajax POST Doesn't Work

Apr 27, 2009

I have a form that should be submitted via ajax; it works of ff and ie, but doesn't in safari 3.2.1.

I've simplified every page to isolate the problem:

The html:

View this message in context: [url] Sent from the jQuery General Discussion mailing list archive at [url].

View 2 Replies View Related

Code - Void Window.open - Link Would Open In The Same Window?

Feb 7, 2009

I have this piece of code which is opening link in new window:

How to change this code so link would open in the same window?

Probably I should change this part: javascript:void window.open

View 1 Replies View Related

JQuery :: Open A Link And Send To It A Post Request?

Jun 30, 2009

I was guessing if it was possible, using jQuery, to have a link that, when clicked, opens the relative url and sends to it a post request. I'm trying to do this with the $.post function, but i found the problem that the request is sent, but the page isn't opened.

This is my code:
<html>
<head>
<script type="text/javascript" src="jquery.js"></script>

[Code]....

View 1 Replies View Related

Links That Uses Window.open Then Open A New Designated Window

Jan 17, 2012

I have a problem on the links on my page im working.sorry guys still a noob and my english is not that good. :b. my question is like i have a list of packages of food. [link_a] [link_b] [link_c] and i have a function that i put in my head tag:

function linkA()
{
window.open('link_a.html','link','width=300,height=200,resizable=yes');
}

now i can go to linka.html by click my link <A HREF="javascript:linkA()" >link a</A> is there a way i can have one functions that can open a link depend on what page .when it clicks then go to its designated page or i have to stick on writing function for linkB ,C,D and so on.

View 7 Replies View Related

Open A Link On The Same Window Using Window.open Or Any Other Method?

Oct 19, 2011

How to open a link on the same window using window.open or any other method in JavaScript.

View 2 Replies View Related

Child Window Close Event - Opening Another Link In A Separate Window Using Window.open()

Jan 29, 2010

I have a HTML and I am opening another link in a separate window using window.open() . The child window is something like 'http://yahoo.com' which is out side html. I need to refresh the parent window when the child window is closed.

View 4 Replies View Related

JQuery :: GetJSON Fail On Callback - Callback Is Never Called ?

Apr 13, 2010

I use the getJSON request to fill a select (with cities names) after the user have choosen his region.

I paste some code:

The problem is that callback is never called. I used firebug and i have seen that when i change region the getJSON function is called and my script (python) return this JSON:

Why my callback is not called? I can't even get the alert ('callback time!'). I thinked that my json could be broken, but firebug net console read and parse it very well, so i think is valid JSON.

I also tried to split up the function declaration from the getJSON request, but it's no use.

View 5 Replies View Related

Open In New Browser Window (like With Target="_blank", Not Window.open)

Dec 1, 2011

Code: window.location but have it open in new browser window (like with target="_blank", not window.open)

View 7 Replies View Related

Thru Window.open Open A Word Document In Print Preview Mode

Jul 23, 2005

Through window.open or window.showmodaldialog, I want to open a word
or excel document in Print Preview mode. Bcos I don't want the user to
make any changes or save it but the user can ONLY VIEW OR take a print
out.

View 1 Replies View Related

Window.Open In FireFox - Click Very Quickly - Multiple Windows Open

Nov 16, 2009

I'm using an <A> tag with an onclick event to open a window with JS (window.open)... In FIREFOX, if I click very quickly, multiple windows open. Not a problem in IE.

View 8 Replies View Related

Open POST Response In Div?

Aug 4, 2009

I have a main.php page with multiple divs. I load whole pages in these divs using AJAX. Some of these pages have forms with submit buttons. The structure of the pages is like so[code]...

So the form is processed by acc_settings.php itself. When the submit button is pressed, the form info is sent to acc_settings but the browser loads up acc_settings.php

What I want is that the form should remain the way it is but the response should be displayed in the same div in main.php and acc_settings.php should not be opened by the browser.

View 9 Replies View Related

Window.open - How To Open A Local File (xml) With Firefox

Apr 2, 2008

my file is located at c:AdminFiles.xml

i tried the following ways

window.open("c:/AdminFiles.xml",'HeavyXml');
window.open("c:AdminFiles.xml",'HeavyXml');
window.open("c:\AdminFiles.xml",'HeavyXml');

in the above i'm getting the following error: "Firefox doesn't know how to open this address, because the protocol (c) isnt associated with any program"

window.open("file:///c:\AdminFiles.xml",'HeavyXml');

the last attempt give to respond at all...

View 5 Replies View Related

File Open And POST To Server

May 6, 2009

I'm trying to read a file (will be a firmware update) into a byte array or binary stream or stream of some sort, and then POST it to my server. Any suggestions on opening and reading files from within js? Note, the server is a development server and will not run PHP or CGI scripts for example. I just need to be able to open a file from within a js function.

Also, no ActiveX objects, this needs to be Cross Platform.

View 3 Replies View Related

Open Post Data How To Keep Text Formatting?

Apr 19, 2011

im sure this will be pretty simple, at the moment i have some code which sends text from a textarea to a php file, the php file then stores the data into a database.the javascript post is as follows:

var text = document.getElementById(area).value;
http.open('post', 'autosave.php?text='+text);

there is a little bit more to this(just a handle response).My issue is that when the data is passed through javascript newlines and breaks disappear, so when i call the saved data it is presented as one long string with no formatting.i tried the nl2br() function and htmlspecialchars() function in the php file that the javascript passes the data to, this made no difference. I then tried to replace /n with <br /> in the javascript before passing the text variable again this made no differnce.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved