Search Results

Search found 7724 results on 309 pages for 'backbone js'.

Page 42/309 | < Previous Page | 38 39 40 41 42 43 44 45 46 47 48 49  | Next Page >

  • problem with prototype.js Ajax functions

    - by Maksim Burnin
    my code(prototype 1.6.1) Event.observe(window, 'load', function() { new Ajax.Request('/modal/order_same/', { parameters: {}, onComplete: function(){alert('err0');}, onSuccess:function(){alert('err1');}, onCreate:function(){alert('err2');}, onFailure:function(){alert('err3');}, onException:function(){alert('err4');}, onLoaded:function(){alert('err5');} }); }); or Event.observe(window, 'load', function() { new Ajax.Updater(somelement,'/modal/order_same/', { parameters: {}, onComplete: function(){alert('err0');}, onSuccess:function(){alert('err1');}, onCreate:function(){alert('err2');}, onFailure:function(){alert('err3');}, onException:function(){alert('err4');}, onLoaded:function(){alert('err5');} }); }); all i get in ff3.7prea5 is "err2". my client says he has ff3.6.3 and same error firebug console says he's get the response and the status code is 200 works fine in opera, ie 6-8, ff on some computers any suggestions?

    Read the article

  • JS text to array

    - by Sonny
    Hi i got this text 2/92/20 3/32/32 4/62/6 5/22/28 6/60/61 7/33/32 8/34/31 9/31/19 10/19/19 11/34/39 12/32/32 14/19/25 15/45/37 16/32/32 17/84/36 18/72/33 and i need it to be like // 2/92/20 chars[0][0]=2; chars[0][1]=92; chars[0][2]=20; How should i make that PS: the split must be in $.ajax({ type: "POST", url: "char_info2.php", dataType: "html", success: function(data) { //here }

    Read the article

  • Passing Variable or Something to Iframe Parent PHP/JS/Html

    - by Belgin Fish
    Alright, well this is the deal. I have a page, and then it loads an iframe. When anything inside the iframe is clicked, the main page (iframe parent) just reloads. How can I have it, so that if the iframe parent is reloaded from a click inside the iframe that a certain boolean or something is passed, displaying something different. Thanks

    Read the article

  • js regexp problem

    - by Alexander
    I have a searching system that splits the keyword into chunks and searches for it in a string like this: var regexp_school = new RegExp("(?=.*" + split_keywords[0] + ")(?=.*" + split_keywords[1] + ")(?=.*" + split_keywords[2] + ").*", "i"); I would like to modify this so that so that I would only search for it in the beginning of the words. For example if the string is: "Bbe be eb ebb beb" And the keyword is: "be eb" Then I want only these to hit "be ebb eb" In other words I want to combine the above regexp with this one: var regexp_school = new RegExp("^" + split_keywords[0], "i"); But I'm not sure how the syntax would look like. I'm also using the split fuction to split the keywords, but I dont want to set a length since I dont know how many words there are in the keyword string. split_keywords = school_keyword.split(" ", 3); If I leave the 3 out, will it have dynamic lenght or just lenght of 1? I tried doing a alert(split_keywords.lenght); But didnt get a desired response

    Read the article

  • Form still posts back with return false in JS

    - by jiewmeng
    it seems like #frmToDo still posts backs <form id="frmToDo" name="frmToDo"> ... <a id="btnSubmit" href="javascript:document.frmToDo.submit();">Add</a> google.load("jquery", 1); google.load("jqueryui", 1); google.setOnLoadCallback(function() { ... $("#frmToDo").submit(function() { return false; ... why will this happen? might it be because of href="javascript:document.frmToDo.submit(). how can i submit the form with that link (i didnt use <input type="submit" /> because of styling problems, it seems like buttons are harder to style, esp in different browsers) the AJAX way?

    Read the article

  • Getting started with game development using js/html5

    - by joe
    Anyone have experience with game development using javascript and the html5 canvas element? So far I have found two libraries, are either of these worth using? http://tommysmind.com/ (XNA Port) http://gamequery.onaluf.org/ (jquery plugin) Does anyone have any other resources?

    Read the article

  • [js] how combine to functions on submit?

    - by Mahmoud
    hey there, as you can see, i have to functions first to check if all forms are not empty and the second function is to verify the captcher, when i combine them together both work at the same time, i want to first to verify the first function, when that function returns true then the other function starts, here is the code that i used on form <form action="reg.php" method="post" enctype="application/x-www-form-urlencoded" onsubmit=" Checking(this); return jcap();" > As you can see both function execute at the same time so i tried this <form action="reg.php" method="post" enctype="application/x-www-form-urlencoded" onsubmit=" if(Checking(this) == true ){ return jcap();}" > is bypass both

    Read the article

  • Use JS to add characters into textfield

    - by Thomas
    I want to add a $ symbol before a users entry into a text field without actually submitting the $ when the user clicks submit. Additionally, I need to prohibit the user from entering anything but numerical values in to the text input. I know about the JQuery input mask (http://www.conetrees.com/2009/03/blog/jquery-masked-input-plugin-increase-usability-for-masked-format-input-fields) but this plugin requires you to set the exact number of digits/letters that the user is supposed to enter, which is no good for my current project. Can anyone think of a way to accomplish what I have described above?

    Read the article

  • Globally disable Ext JS Animations

    - by ifwdev
    I'm testing an intranet web app in the iPad but the animations to open "windows" and show message boxes are horribly slow. I've tried setting the global Ext.enableFx to false, and confirmed that flag is still false after page load in Firebug. The animations are still occurring though so I must be doing something wrong. Thanks...

    Read the article

  • Convert Google results object (pure js) to Python object

    - by colwilson
    So I'm trying to use Google Map suggest API to request place name suggestions. Unfortunately I can't find the docs for this bit. Here is an example URI: http://maps.google.com/maps/suggest?q=lon&cp=3&ll=55.0,-3.5&spn=11.9,1.2&hl=en&gl=uk&v=2 which returns: {suggestion:[{query:"London",... I want to use this in python (2.5). Now in proper JSON there would have been quotations around the keys like so: {"suggestion":[{"query":"London",... and I could have used simplejson or something, but as it is I'm a bit stuck. There are two possible solutions here; either I can get to the API code and find an option to return proper JSON, or I do that in python. Any ideas please.

    Read the article

  • help me understand JS execution on onclick event of button

    - by Anil Namde
    <input type="button" name="reset" onclick="return ValidateValue(); __doPostBack('ApplyBtn','')" /> The above is the code generated for asp server button button control on browser. Now my query is that irrespective of ValidateValue() returning true/false __doPostBack('ApplyBtn','') function is not showing any effect for me. My understanding is that string passed to onclick acts like function body, and return will from first function will return control preventing second function from execution. Is that correct ? Please provide helpful inputs.

    Read the article

  • Special Characters in JS, how to use "/" character

    - by user1461222
    I've vbulletin 4.2.0 i added an special button to it's editor with this article; http://www.vbulletinguru.com/2012/add-a-new-toolbar-button-to-ckeditor-tutorial/ The thing i want to do is add an syntax highlighter code with this button. When i use below code it's working fine; CKEDITOR.plugins.add( 'YourPluginName', { init: function( editor ) { editor.addCommand( 'SayHello', { exec : function( editor ) { editor.insertHtml( "Hello from my plugin" ); } }); editor.ui.addButton( 'YourPluginName', { label: 'My Button Tooltip', command: 'SayHello', icon: this.path + 'YourPluginImage.png' } ); } } ); so i changed this code to this, because i wannt to add specific text like below; CKEDITOR.plugins.add( 'DKODU', { init: function( editor ) { editor.addCommand( 'SayHello', { exec : function( editor ) { editor.insertHtml( '[kod=delphi][/kod]' ); } }); editor.ui.addButton( 'DKODU', { label: 'My Button Tooltip', command: 'SayHello', icon: this.path + 'star.png' } ); } } ); after update the code when i press the button nothings happen, i checked with google and this site but i couldn't figure it out i think i made mistake with some special characters but i couldn't find what's the problem. If i made some mistakes when i publish this question forgive me and also forgive me for my bad english, thanks.

    Read the article

  • Result of expression 'xxxx' is not a constructor in JS

    - by Pselus
    Trying to create an object in Javascript (for Appcelerator/Titanium). The "object" is defined like this: function server () { this.cacheimages = 0; this.login = ""; this.name = ""; this.root = ""; this.signup = ""; this.useimages = 0; this.userexists = ""; this.isdefault = 0; return this; } In the same file, in another function when I run this line: var server = new server(); I get the error Result of expression 'server' is not a constructor. I have tried it with and without the "return" line, neither work. What am I doing wrong?

    Read the article

  • How to protect a form HTML/PHP with JS callback to AS3

    - by Jk_
    Hi guys, I'm developing a Flash website (as3) where I need to be able to upload directly to YouTube by using the DATA API. However in order to do so, I had to use a proper HTML form on top of my flash object. Why? Because of the Browser Based Upload restictions. I first hide the form using JQuery and with a little CSS the form is display just where I want it. Within flash I use ExternalInterface.call() to show/hide the form when I need it! ExternalInterface.call("YTUploader.showIt"); The upload process is working great my only problem is that the form can be displayed easily... You just need a tool like firebug and you can use the form wherever you want on my flash app. So I was wandering which will be the best way to 'protect' this form or the best way to limit its access. Any advices will be appreciated. Thanks for your time. Jk.

    Read the article

  • JS and Body(Window) Onload event

    - by Ilian
    I have a problem with onload event. My page have 4 iframes and the function from onload event is called 5 times ( one for body and 4 for iframes ). I want only 1 time ( from main body ). Try with srcElement and target property from windows.event but no result... Is there a way to stop onload when iframes load?

    Read the article

  • ASP.NET Web Optimization - confusion about loading order

    - by Ciel
    Using the ASP.NET Web Optimization Framework, I am attempting to load some javascript files up. It works fine, except I am running into a peculiar situation with either the loading order, the loading speed, or its execution. I cannot figure out which. Basically, I am using ace code editor for javascript, and I also want to include its autocompletion package. This requires two files. /ace.js /ext-language_tools.js This isn't an issue, if I load both of these files the normal way (with <script> tags) it works fine. But when I try to use the web optimization bundles, it seems as if something goes wrong. Trying this out... bundles.Add(new ScriptBundle("~/bundles/js") { .Include("~/js/ace.js") .Include("~/js/ext-language_tools.js") }); and then in the view .. @Scripts.Render("~/bundles/js") I get the error ace is not defined This means that the ace.js file hasn't run, or hasn't loaded. Because if I break it apart into two bundles, it starts working. bundles.Add(new ScriptBundle("~/bundles/js") { .Include("~/js/ace.js") }); bundles.Add(new ScriptBundle("~/bundles/js/language_tools") { .Include("~/js/ext-language_tools.js") }); Can anyone explain why this would behave in this fashion?

    Read the article

  • Hidden divs for "lazy javascript" loading? Possible security/other issues?

    - by xyld
    I'm curious about people's opinion's and thoughts about this situation. The reason I'd like to lazy load javascript is because of performance. Loading javascript at the end of the body reduces the browser blocking and ends up with much faster page loads. But there is some automation I'm using to generate the html (django specifically). This automation has the convenience of allowing forms to be built with "Widgets" that output content it needs to render the entire widget (extra javascript, css, ...). The problem is that the widget wants to output javascript immediately into the middle of the document, but I want to ensure all javascript loads at the end of the body. When the following widget is added to a form, you can see it renders some <script>...</script> tags: class AutoCompleteTagInput(forms.TextInput): class Media: css = { 'all': ('css/jquery.autocomplete.css', ) } js = ( 'js/jquery.bgiframe.js', 'js/jquery.ajaxQueue.js', 'js/jquery.autocomplete.js', ) def render(self, name, value, attrs=None): output = super(AutoCompleteTagInput, self).render(name, value, attrs) page_tags = Tag.objects.usage_for_model(DataSet) tag_list = simplejson.dumps([tag.name for tag in page_tags], ensure_ascii=False) return mark_safe(u'''<script type="text/javascript"> jQuery("#id_%s").autocomplete(%s, { width: 150, max: 10, highlight: false, scroll: true, scrollHeight: 100, matchContains: true, autoFill: true }); </script>''' % (name, tag_list,)) + output What I'm proposing is that if someone uses a <div class=".lazy-js">...</div> with some css (.lazy-js { display: none; }) and some javascript (jQuery('.lazy-js').each(function(index) { eval(jQuery(this).text()); }), you can effectively force all javascript to load at the end of page load: class AutoCompleteTagInput(forms.TextInput): class Media: css = { 'all': ('css/jquery.autocomplete.css', ) } js = ( 'js/jquery.bgiframe.js', 'js/jquery.ajaxQueue.js', 'js/jquery.autocomplete.js', ) def render(self, name, value, attrs=None): output = super(AutoCompleteTagInput, self).render(name, value, attrs) page_tags = Tag.objects.usage_for_model(DataSet) tag_list = simplejson.dumps([tag.name for tag in page_tags], ensure_ascii=False) return mark_safe(u'''<div class="lazy-js"> jQuery("#id_%s").autocomplete(%s, { width: 150, max: 10, highlight: false, scroll: true, scrollHeight: 100, matchContains: true, autoFill: true }); </div>''' % (name, tag_list,)) + output Nevermind all the details of my specific implementation (the specific media involved), I'm looking for a consensus on whether the method of using lazy-loaded javascript through hidden a hidden tags can pose issues whether security or other related? One of the most convenient parts about this is that it follows the DRY principle rather well IMO because you don't need to hack up a specific lazy-load for each instance in the page. It just "works". UPDATE: I'm not sure if django has the ability to queue things (via fancy template inheritance or something?) to be output just before the end of the </body>?

    Read the article

  • getting an onclick event to a select option using js

    - by Vadim.G
    i am having a very frustrating problem. I have this code which filters out my results and inputs them into a select box var syn = <?=json_encode($syn)?>; function filterByCity() { var e = document.getElementById("city_filter"); var city = e.options[e.selectedIndex].value; var selectOptions = document.getElementById('syn_list'); selectOptions.options.length = 0; for (i = 0; i < syn.length; i++) { if (city == syn[i]['city'] || city == 'all') { selectOptions.options[selectOptions.options.length] = new Option(syn[i]['name'], syn[i]['id'] + '" onclick="updateTxtContent(\'' + syn[i]['id'] + '\')'); } } } as you might see i am adding a onclick listener to every select "option" which look great in the source code of the page itself but if i copy it into an edit i notice this my problem is that the "updateTxtContent()" function is not called. <select size="10" name="syn_list" id="syn_list" class="span12" dir="rtl" style="text-align:right;"> <option value="13&quot; onclick=&quot;updateTxtContent('13')">option a</option> <option value="14&quot; onclick=&quot;updateTxtContent('14')">option b</option> obviously there should be a better way to do this that i am not aware of.

    Read the article

  • js object problem

    - by haltman
    Hi everybay! I use an object to check that a group of radio buttons have a precise value like set on "rule" object. Here is an example: arr = {a:"1", b:"1", c:"1", c:"2"}; //that's my object rule var arr2={}; //here I create my second array with charged value $("#form_cont input:checked").each(function() { arr2[$(this).attr("name")]=$(this).val(); }); //here I make the check for (k in arr2) { if (typeof arr[k] !== 'undefined' && arr[k] === arr2[k]) { $("#form_cont li[name$='"+k+"']").css('background-color', ''); } else { $("#form_cont li[name$='"+k+"']").css('background-color', 'pink'); } } The problem is when I have to check the "c" key I get last the one (2) and not the right value how that may e 1 or 2 thanks in advance ciao, h.

    Read the article

  • Another passing variable through function jQuery/JS problem...

    - by dallen
    Here's my code: function mouseOver(variable) { return function() { $(variable).fadeIn(100); }; } function mouseOut(variable) { return function() { $(variable).fadeOut(100); }; } function lawyer(var1, var2, var3, var4) { return function() { $(var1).bind('mouseenter', mouseOver(var2)).bind('mouseleave', mouseOut(var2)).click( function() { $(var1).unbind('mouseenter').unbind('mouseleave'); $(var1).removeClass('off').addClass('on'); $(var3).bind('mouseenter', mouseOver(var4)).bind('mouseleave', mouseOut(var4)); $(var3).removeClass('on').addClass('off'); $(var4).hide(); }); } } lawyer("#group", ".b", "#group2", ".l"); What would be the reason for this not working? It works in that it hides $(var4).hide();, but clicking on the object doesn't seem to do anything. It works if I take the code out of a function and just copy/paste it a few times and change the targets. I'm not seeing it... Any help would be appreciated!

    Read the article

  • Ray intersection and child camera

    - by lutangar
    I've been playing with three.js for few weeks now and got few inconsistencies on ray casting. Here is a simplified version demonstrating one of the bug I encoutered : http://jsfiddle.net/eMrhb/12/ The camera is added to the sphere mesh for further use of TrackBallControl for example. scene.add(mesh); mesh.add(camera); Clicking a few times on the sphere and opening the console, show us none of the expected intersections between the ray and the mesh. Adding the camera to the scene (http://jsfiddle.net/eMrhb/9/), solves the problem: scene.add(mesh); scene.add(camera); But I could use a much more complex hierarchy between my scene objects and the camera to suit my needs. Is this a limitation? If it is, is there any workarounds I could use?

    Read the article

  • Youtube video on load through Jquery/JS

    - by jonthecoder2346
    My goal is to display a youtube video through a javascript function that will read the embedded code and load the video automatically in the div assigned. But I am not getting anything shown in the div assigned for the video. Is it because it has to be triggered by a button click? <script type="text/javascript"> var last_cnad_text_1 = ''; var options_cnad_text_1 = { embedMethod:'fill', maxWidth:320, maxHeight: 320 }; function loadVideo() { val = $('#cnad_text_1').val(); if ( val != '' && val != last_cnad_text_1 ) { last_cnad_text_1 = val; $("#embed_cnad_text_1").oembed(val,options_cnad_text_1); } } $(function(){ $('#cnad_text_1').keydown(loadVideo()); $('#cnad_text_1').click(loadVideo()); $('#cnad_text_1').change(loadVideo()); }); </script> <body> <input id="cnad_text_1" type="text" value="" size="60" name="cnad[text_1]"> <div id="embed_cnad_text_1"></div> </body> </html>

    Read the article

  • Hooking a synchronous event handler on a form submit button in JS

    - by Xzhsh
    Hi, I'm working on a security project in javascript (something I honestly have not used), and I'm having some trouble with EventListeners. My code looks something like this: function prevclick(evt) { evt.preventDefault(); document.loginform.submitbtn.removeEventListener('click',prevclick,false); var req = new XMLHttpRequest(); req.open("GET","testlog.php?submission=complete",false); req.send(); document.loginform.submitbtn.click(); //tried this and loginform.submit() } document.loginform.submitbtn.addEventListener('click',prevclick,false); But the problem is, the submit button doesn't submit the form on the first click (it does, however, send the http request on the first click), and on the second click of the submit button, it works as normal. I think there is a problem with the synchronization, but I do need to have the request processed before forwarding the user to the next page. Any ideas on this would be great. Thanks in advance.

    Read the article

< Previous Page | 38 39 40 41 42 43 44 45 46 47 48 49  | Next Page >