Search Results

Search found 4827 results on 194 pages for 'alert'.

Page 30/194 | < Previous Page | 26 27 28 29 30 31 32 33 34 35 36 37  | Next Page >

  • Publish to Current user's wall using FBJS in FBML application

    - by Damodaran
    Hi I need to publish some message to the current user's wall using FBJS in FBML application. When I use window.fbAsyncInit = function() { FB.init({appId: 'MY_APP_ID', status: true, cookie: true, xfbml: false}); }; i am getting an error :- FB is not defined. and window is not defined. For publishing i am using this code function graphStreamPublish(){ var body = document.getElementById("txtTextToPublish").value; FB.api('/me/feed', 'post', { message: body }, function(response) { if (!response || response.error) { // alert('Error occured'); } else { // alert('Post ID: ' + response.id); } }); } (I cannot use alert in facebook..) Thanks in advance..

    Read the article

  • Why Is my json-object from AJAX not understood by javascript, even with 'json' dataType?

    - by pete
    My js code simply gets a json object from my server, but I think it should be automatically parsed and turned into an object with properties, yet it's not allowing access properly. $.ajax({ type: 'POST', url: '/misc/json-sample.js', data: {href: path}, // THIS IS THE POST DATA THAT IS PASSED IN TO THE DRUPAL MENU CALL TO GET THE MENU... dataType: 'json', success: function (datax) { if (datax.debug) { alert('Debug data: ' + datax.debug); } else { alert('No debug data: ' + datax.toSource() ) ; } The /misc/json-sample.js file is: [ { "path": "examplemodule/parent1/child1/grandchild1", "title": "First grandchild option", "children": false } ] (I have also been trying to return that object from drupal as follows, and the same results.) Drupal version of misc/json-sample.js: $items[] = array( 'path' = 'examplemodule/parent1/child1/grandchild1', 'title' = t('First grandchild option'), 'debug' = t('debug me!'), 'children' = FALSE ); print drupal_to_js($items); What happens (in FF, which has the toSource() capability) is the alert with 'No debug data: [ { "path": "examplemodule/parent1/child1/grandchild1", "title": "First grandchild option", "children": false } ] Thanks

    Read the article

  • Javascript instanceof & typeof in GWT (JSNI)

    - by rybz
    Hi, I've encountered an curious problem while trying to use some objects through JSNI in GWT. Let's say we have javscript file with the function defined: test.js: function test(arg){ var type = typeof(arg); if (arg instanceof Array) alert('Array'); if (arg instanceof Object) alert('Object'); if (arg instanceof String) alert('String'); } And the we want to call this function user JSNI: public static native void testx()/ *-{ $wnd.test( new Array(1, 2, 3) ); $wnd.test( [ 1, 2, 3 ] ); $wnd.test( {val:1} ); $wnd.test( "Some text" ); }-*/; The questions are: why instanceof instructions will always return false? why typeof will always return "object" ? how to pass these objects so that they were recognized properly?

    Read the article

  • Simple Javascript Won't work

    - by webzide
    Dear Experts, I was testing some code and I became very frustrated as I couldn't even get an simple DOM alert box to work Anyway here's the code <!DOCTYPE HTML PUBLIC "-//W3C/DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/tdt/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <script type="text/javascript"> <!-- var x=document.getElementById("myHeader"); alert(x.innerHTML); //--> </script> </head> <body> <h1 id="myHeader">Click me!</h1> </body> </html> I don't know what I did wrong but I just don't see the alert box. I use FF btw.

    Read the article

  • How to change the BlackBerry volume, or mute it?

    - by devguy
    My current code is this: int volume = Alert.getVolume(); // reads 100 Alert.setVolume(0); It DOESN'T change the volume setting, like it would be supposed to do :( Even calling Alert.mute(true) doesn't produce any good effect. Audio.setVolume(0) also doesn't work! I'm running this on a Curve 8310. I have another software installed though that successfully manages to lower the volume setting a lot...so I suppose I'm doing something wrong. Any idea?

    Read the article

  • page not show after issuing zf command

    - by Nazmin
    hello guys, just simple question, recently i have setup a web server to build project using zend framework, after setup and see those welcome page saying that you are creating websites powered by zendframework, then i try issuing command, $ zf create controller alert i get the message that saying that i've successfully create controller, view and so on, but when i try to navigate to the page by URL, ex: www.mywebapp.com/alert the page is broken, i've check those tuts but none of them showing this case. can some one define which step i've skip? update: (25/5/2010) so i've found that there is no problem, is just that i've not configured properly my route to my web apps, so i have to type URL like this: www.mywebapp.com/index.php/alert how am I going to change this? i mean i want to explode "index.php" out of URL.

    Read the article

  • getting web page data as json object?

    - by encryptor
    I have a url, the data of which page i need as a json object. I ve tried xmlhttprequest and ajaxobject both but doesnt work. It doesnt even give a responseText when I give it as an alert Ill post both the code snippets here. url = http://mydomain.com:port/a/b/c AJAX : var ajaxRequest = new ajaxObject(URL); ajaxRequest.callback = function (responseText,responseStatus) { alert(responseStatus); JSONData = responseText.parseJSON(); processData(JSONData); } USING xmlhttprequest: var client = new XMLHttpRequest(); client.open('GET',URL,true ); data = JSON.parse(client.responseText); alert(data.links.length); can someone please help me out with this. I understand cross scripting may be an issue, but how to come over it? and shouldn't then too it should give the alerts as zero or null

    Read the article

  • Pass dynamic data to mvc controller with AJAX

    - by Yustme
    How can I pass dynamic data with an AJAX call to an MVC Controller? Controller: public JsonResult ApplyFilters(dynamic filters){ return null; } The AJAX call: $(':checkbox').click(function (event) { var serviceIds = $('input[type="checkbox"]:checked').map(function () { return $(this).val(); }).toArray(); //alert(serviceIds); $.ajax({ type: 'GET', url: '/home/ApplyFilters', data: JSON.stringify({ name: serviceIds }), contentType: 'application/json', success: function (data) { alert("succeeded"); }, error: function (err, data) { alert("Error " + err.responseText); } }); //return false; }); Ideally would be that the filters would contain the serviceIds as a property For example like this: filters.ServiceIds. I got another filter for a date range and that one would be added like so: filters.DateRange. And server side get the filter as a dynamic object in the ApplyFilters()

    Read the article

  • jQuery AJAX get request - cannot see returned data

    - by Wes
    I think I am missing something obvious here, but I can't figure it out. I expect the following HTML to alert a response from the server. But, the alert is empty. I can see in Wireshark that the expected response is coming back to me from the server. Why is it not populated in the data variable? <html> <head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> </head> <body> <script type="text/javascript"> $.get("http://www.geocommunicator.gov/TownshipGeocoder/TownshipGeocoder.asmx/GetTRS", {'Lat': 41, 'Lon': -93, 'Units': 'eDD', 'Datum': ''}, function(data) { alert('data:'+data); }); </script> </body> </html>

    Read the article

  • window.onbeforeunload ajax request problem with Chrome

    - by lang2
    Hello, I have a web page that handles remote control of a machine through Ajax. When user navigate away from the page, I'd like to automatically disconnect from the machine. So here is the code: window.onbeforeunload = function () { bas_disconnect_only(); } The disconnection function simply send a HTTP GET request to a PHP server side script, which does the actual work of disconnecting: function bas_disconnect_only() { var xhr = bas_send_request("req=10", function() { } ); } This works fine in FireFox. But with Chrome, the ajax request is not sent at all. There is a unacceptable workaround: adding alert to the callback function: function bas_disconnect_only() { var xhr = bas_send_request("req=10", function() { alert("You're been automatically disconnected."); } ); } After adding the alert call, the request would be sent successfully. But as you can see, it's not really a work around at all. Could somebody tell me if this is achievable with Chrome? What I'm doing looks completely legit to me. Thanks,

    Read the article

  • I cannot get this Jquery Image ComboBox to Work

    - by WillingLearner
    Im trying to use this plugin: http://www.marghoobsuleman.com/jquery-image-dropdown I cannot get it to work in my file. I copied and pasted the code from the example files and made the necessary links to the js and css files just to test, and i still cant get it to work. Everytime i run it, i get this error: Error: Result of expression '$(".mydds").msDropDown' [undefined] is not a function The script im using to run the file is: <script language="javascript" type="text/javascript"> function showvalue(arg) { alert(arg); //arg.visible(false); } $(document).ready(function() { try { oHandler = $(".mydds").msDropDown().data("dd"); oHandler.visible(true); //alert($.msDropDown.version); //$.msDropDown.create("body select"); $("#ver").html($.msDropDown.version); } catch(e) { alert("Error: "+e.message); } }) </script> Why am I getting these errors and how can I fix it?

    Read the article

  • javascript: problem with function

    - by Zayatzz
    hi I have this simple function: <script type="text/javascript"> //<![CDATA[ jQuery(function($){ function here(b){alert(b);} ; here(6); }); //]]> </script> and i have this button on page: <button onclick="here(7);">TEST</button> The alert fires on page load, but not on button click. If i replace the here(7) with alert, it works fine. Why doesnt it work with function though? Alan

    Read the article

  • javascript inherance? with Private vars and methods too

    - by Totty
    Hy i need to inherent a class from another. Parent has private var "_data" and private method "_test" and public method "add" Now the child have a public method "add", that uses the private method from the parent "_test" and the private var "_data". How do i do this? var Parent = function(){ var _data = {}; var _test = function(){alert('test')}; this.add = function(){alert('add from parent')} } var Child = function(){ this.add = function(){// here uses the _data and _test from the Parent class alert('add from child') } } // something to inherent Child from Parent // instance Child and use the add method And i think im miss the prototype concept (http://stackoverflow.com/questions/892467/javascript-inheritance)

    Read the article

  • Javascript Regex multiple group matches in pattern

    - by mummybot
    I have a question for a Javascript regex ninja: How could I simplify my variable creation from a string using regex? I currently have it working without using any grouping, but I would love to see a better way! The string is: var url = 'resources/css/main.css?detect=#information{width:300px;}'; The code that works is: var styleStr = /[^=]+$/.exec(url).toString(); var id = /[^\#][^\{]+/.exec(styleStr).toString(); var property = /[^\{]+/.exec(/[^\#\w][^\:]+/.exec(styleStr)).toString(); var value = /[^\:]+/.exec(/[^\#\w\{][^\:]+[^\;\}]/.exec(styleStr)).toString(); This gives: alert(id) //information alert(property) //width alert(value) //300px Any takers?

    Read the article

  • How to read from CSS files with jQuery

    - by Neurofluxation
    Ok, I have a HTML page with jQuery included. I have a CSS file with a good load of lines in, I would like to read all styles for a given element from the external CSS file... Not the inline styles... I have the following code (which looks like it should work...): var styleProperties= {}; var getCssProperties = ['width', 'margin', 'height']; for (c=0;i<=returnStyleProps.length;c++) { styleProperties[returnStyleProps[c]] = $('div#container').css(returnStyleProps[c]); alert(styleProperties); } alert(styleProperties); But this only seems to alert: "[Object Object]" Any ideas you clever people?

    Read the article

  • ASP.NET single quotes are converted to &#39;

    - by Monty
    Note: Most probably this will be a double question, but since I haven't found a clear answer, I'm asking it anyway. In ASP.NET I'd like to add some JavaScript to the onclick event of a CheckBox. I've simplified the case to this: <asp:CheckBox ID="TestCheckBox" runat="server" onclick="alert('test');" Text="Test" /> The resulting HTML is as follows: <input id="MainContainer_TestCheckBox" type="checkbox" name="ctl00$MainContainer$TestCheckBox" onclick="alert(&#39;test&#39;);" /><label for="MainContainer_TestCheckBox">Test</label> What particularly bothers me is that a single quote 'automatically' gets converted into '&#39;'. If I omit the onclick in the markup and assign it in Page_Load, the exact same results show in the HTML. protected void Page_Load(object sender, EventArgs e) { this.TestCheckBox.Attributes["onclick"] = "alert('test');"; } Anyone got a clue about what's happening? Or how to fix/ avoid it?

    Read the article

  • Can not get json response using $.getJSON

    - by Mellon
    I am currently developing a Ruby on rails 3 application. My server controller function render a json object as response: class DaysController < BaseController ... def the_days ... render :json => days end end In my javascript,I use the following code to get json response from server( that's from the_day function in controller) $.getJSON( url, {emp_id: emp_id}, function(data) { var result = data.response; alert(result) alert(data) }, "json" ); I use firefox browswer and checked with Firebug, in Firebug Net-XHR, I see the Get request is successful, and the response "days" is there. That's both request and response are successful. But I did not see the two alert window defined in the above $.getJSON function, why? Why I can not get the response "days" in $.getJSON function??

    Read the article

  • scope of variables in JavaScript callback functions

    - by Ethan
    I expected the code below to alert "0" and "1", but it alert "2" twice. I don't the reason. Don't know if it is a problem of jQuery. Also, please help me to edit title and tags of this post if they are inaccurate. <html> <head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript"> $(function() { for (var i=0; i<2; i++) { $.get('http://www.google.com/', function() { alert(i); }); } }); </script> </head> <body> </body> </html>

    Read the article

  • Javascript form validation - multiple form fields larger than 0

    - by calebface
    function negativeValues(){ var myTextField = document.getElementById('digit'); if(myTextField.value < 0) { alert("Unable to submit as one field has a negative value"); return false; } } Above is a Javascript piece of code where every time a field id 'digit' has a value that's less than 0, than an alert box appears either onsubmit or onclick in the submit button. There are about 50 fields in the form that should be considered 'digit' fields where they shouldn't be anything less than 0. What should I change with this Javascript to ensure that all 'digit' like fields have this alert box pop up? I cannot use jquery/mootools for validation - it has to be flat Javascript. Thanks.

    Read the article

  • why does $.ajax(..) not work for me?

    - by dr jerry
    I'm running jquery from a file. And I'm trying to load a svg file from my localhost to populate a svg canvas. However that does not work as expected. What I do from filesystem: $.ajax({ url: url , timeout: 1000, complete: function(xml) { alert('complete'); }, success: function(xml, status, xreq) { alert('success'); }, error: function() { alert('error'); } }); the url reads: http://localhost/image.svg, when I read this url directly from an addressbar from the browser, the pages remains white but the pagesource displays the source of image.svg. Debugging the $.ajax code above, reveals that the success: method is hit, but xml response remains empty. Any help is greatly appreciated. regards, jeroen.

    Read the article

  • IE8 + Jquery ajax call giving parsererror from dJango : for json data which seems valid in Firefox

    - by PlanetUnknown
    The ajax call works fine in FF. the data returned is in JSON here is an example from FF firebug - {"noProfiles": "No profiles have been created, lets start now !"} When I try to print the error in IE8 (& in compatibility modes as well), it says "parsererror". But the output seems to be valid JSON. Here is the ajax function call I'm making. Any pointers would be great ! $.ajax({ type: "GET", url: "/get_all_profile_details/", data: "", dataType: "json", beforeSend: function() {alert("before send called");}, success: function(jsonData) { alert("data received"); }, error: function(xhr, txt, err){ alert("xhr: " + xhr + "\n textStatus: " + txt + "\n errorThrown: " + err); } }); The alerts in the error function above give - xhr:<blank> textstatus:parsererror errorThrown: undefined Any pointers would be great ! Note : jquery : 1.3.2

    Read the article

  • iPhone WebApp Question

    - by Henry D'Andrea
    I have this code- /** Save the web view as a screenshot. Currently only supports saving to the photo library. / - (void)saveScreenshot:(NSArray)arguments withDict:(NSDictionary*)options { CGRect screenRect = [[UIScreen mainScreen] bounds]; CGRect imageRect = CGRectMake(0, 0, CGRectGetWidth(screenRect), CGRectGetHeight(screenRect)); UIGraphicsBeginImageContext(imageRect.size); [webView.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); UIImageWriteToSavedPhotosAlbum(viewImage, self, nil, nil); UIAlertView *alert= [[UIAlertView alloc] initWithTitle:nil message:@"Image Saved" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alert show]; [alert release]; } This is for saving whatever you drew in my app. How would I add the button for this in the HTML code. How do i call from it?

    Read the article

  • Call function from hyperlink defined in qTip content

    - by user327066
    Hi, I am trying to call a javascript function from a hyperlink that is part of the content in a qTip. I keep getting the error my function is not defined but it is defined within the page and can be called outside of qTip. Below is what I have so far: function addTooltip() { $("#mycontent").qtip({ content: 'mylink' }); } function tester() { alert("hello world"); } If I put the alert within the onClick attribute, I at least get the alert to work. Is there some special way of calling a function from within qTip? Any help is appreciated. Thanks.

    Read the article

  • The impossible inline Javascript delay/sleep

    - by trex005
    There is a JavaScript function, of which I have zero control of the code, which calls a function that I wrote. My function uses DOM to generate an iFrame, defines it's src and then appends it to another DOM element. However, before my function returns, and thus allows continued execution of the containing function, it is imperative that the iFrame be fully loaded. Here are the things that I have tried and why they do not work : 1. The SetTimeout option : 99.999% of the time, this is THE answer. As a matter of fact, in the past decade that I have been mentoring in JavaScript, I have always insisted that code could always be refactored to use this option, and never believed a scenario existed where that was not the case. Well, I finally found one! The problem is that because my function is being called inline, if the very next line is executed before my iFrame finishes loading, it totally neuters my script, and since the moment my script completes, the external script continues. A callback of sorts will not work 2. The "Do nothing" loop :This option you use while(//iFrame is not loaded){//do nothing}. In theory this would not return until the frame is loaded. The problem is that since this hogs all the resources, the iFrame never loads. This trick, although horribly unprofessional, dirty etc. will work when you just need an inline delay, but since I require an external thread to complete, it will not.In FF, after a few seconds, it pauses the script and an alert pops up stating that there is an unresponsive script. While that alert is up, the iFrame is able to load, and then my function is able to return, but having the browser frozen for 10 seconds, and then requiring the user to correctly dismiss an error is a no go. 3. The model dialogue : I was inspired by the fact that the FF popup allowed the iFrame to load while halting the execution of the function, and thinking about it, I realized that it is because the modal dialogue, is a way of halting execution yet allowing other threads to continue! Brilliant, so I decided to try other modal options. Things like alert() work beautifully! When it pops up, even if only up for 1/10th of a second, the iFrame is able to complete, and all works great. And just in case the 1/10 of a second is not sufficient, I can put the model dialogue in the while loop from solution 2, and it would ensure that the iFrame is loaded in time. Sweet right? Except for the fact that I now have to pop up a very unprofessional dialogue for the user to dismiss in order to run my script. I fought with myself about this cost/benefit of this action, but then I encountered a scenario where my code was called 10 times on a single page! Having to dismiss 10 alerts before acessing a page?! That reminds me of the late 90s script kiddie pages, and is NOT an option. 4. A gazillion other delay script out there:There are about 10 jQuery delay or sleep functions, some of them actually quite cleverly developed, but none worked. A few prototype options, and again, none I found could do it! A dozen or so other libraries and frameworks claimed they had what I needed, but alas they all conspired to give me false hope. I am convinced that since a built in model dialogue can halt execution, while allowing other threads to continue, there must be some code accessible way to do the same thing with out user input. The Code is literally thousands upon thousands of lines and is proprietary, so I wrote this little example of the problem for you to work with. It is important to note the ONLY code you are able to change is in the onlyThingYouCanChange function Test File : <html> <head> </head> </html> <body> <div id='iFrameHolder'></div> <script type='text/javascript'> function unChangeableFunction() { new_iFrame = onlyThingYouCanChange(document.getElementById('iFrameHolder')); new_iFrame_doc = (new_iFrame.contentWindow || new_iFrame.contentDocument); if(new_iFrame_doc.document)new_iFrame_doc=new_iFrame_doc.document; new_iFrame_body = new_iFrame_doc.body; if(new_iFrame_body.innerHTML != 'Loaded?') { //The world explodes!!! alert('you just blew up the world! Way to go!'); } else { alert('wow, you did it! Way to go!'); } } var iFrameLoaded = false; function onlyThingYouCanChange(objectToAppendIFrameTo) { iFrameLoaded = false; iframe=document.createElement('iframe'); iframe.onload = new Function('iFrameLoaded = true'); iframe.src = 'blank_frame.html'; //Must use an HTML doc on the server because there is a very specific DOM structure that must be maintained. objectToAppendIFrameTo.appendChild(iframe); var it = 0; while(!iFrameLoaded) //I put the limit on here so you don't { //If I was able to put some sort of delay here that paused the exicution of the script, but did not halt all other browser threads, and did not require user interaction we'd be golden! //alert('test'); //This would work if it did not require user interaction! } return iframe; } unChangeableFunction(); </script> </body> blank_frame.html : <html> <head> </head> <body style='margin:0px'>Loaded?</body> </html>

    Read the article

  • RadioButtonList javascript firing twice

    - by Muralidhar
    I am working with .NET 1.1. The RadioButtonList's AutoPostBack is set to TRUE. I added a client script to display an alert with the selected value. But, the alert is displaying twice - before and after the post back. Here is the code.. //javascript function getRadioButtonListSelection(radioButtonListId) { var elementRef = document.getElementById(radioButtonListId); var radioButtonListArray = elementRef.getElementsByTagName('input'); var checkedValues = ''; for (var i=0; i<radioButtonListArray.length; i++) { var radioButtonListRef = radioButtonListArray[i]; if ( radioButtonListRef.checked == true ) { checkedValues = radioButtonListRef.value; break; } } alert(checkedValues); } //code behind in Page_load() rbl.Attributes.Add("onclick", "javascript:getRadioButtonListSelection('" + rbl.ClientID + "');"); where could I went wrong?

    Read the article

< Previous Page | 26 27 28 29 30 31 32 33 34 35 36 37  | Next Page >