Search Results

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

Page 134/309 | < Previous Page | 130 131 132 133 134 135 136 137 138 139 140 141  | Next Page >

  • getElementById does return null

    - by pbcoder
    I have following function: $('canvas').createWindow('xyz', 500, 600); And js-code behind is: var $ = function(element) { if (this.constructor !== $) { return new $(element); } alert(element); var windowObj = document.getElementById(element); this.createWindow = function(src, width, height) { if(width != "" && height != "") { windowWidth = windowObj.style.width = width + 'px'; windowHeight = windowObj.style.height = height + 'px'; } }; }; But the problem is that JS says windowObj is null, alert(element) works fine! Thanks for your help!

    Read the article

  • How to remove "index.php?" from HTACCESS [duplicate]

    - by Francis Goris
    This question already has an answer here: Reference: mod_rewrite, URL rewriting and “pretty links” explained 2 answers I have url like this: www.site.com/index.php?/genero/aventura/av/ But I would like this to be my new url: site.com/genero/aventura/av/ I used the following code: <IfModule mod_rewrite.c>RewriteEngine On RewriteCond %{HTTP_HOST} !^www.site.com/$ [NC] RewriteRule ^index.php\?/(.*)$ site.com/$1 [R=301,L] </IfModule> but only returns me: site.com/index.php?/genero/aventura/av/ This is my latest & full version: RewriteEngine on #RewriteCond $1 !^(index\.php|ver_capitulo\.html|google3436eb8eea8b8d6e\.html|BingSiteAuth\.xml |portadas|public|mp3|css|favicon\.ico|js|plantilla|i|swf|plugins|player\.swf|robots\.txt) RewriteCond $1 !^(index\.php|public|css|js|i|feed|portadas|robots\.txt|BingSiteAuth\.xml|plugins|i|mp3|favicon\.ico|pluginslist\.xml|google3436eb8eea8b8d6e\.html) RewriteRule ^(.*)$ /index.php?/$1 [L] #DirectoryIndex index.php #RewriteCond %{THE_REQUEST} http://www.page.com/index\.php [NC] #RewriteRule ^(.*?)index\.php$ http://page.com/$1 [L,R=301,NC,NE] #DirectoryIndex index.php #RewriteEngine On Thanks for reading.

    Read the article

  • Jquery .load and inner jquery .append

    - by speekeazy
    Hello, Ive just started using jquery for the .load ajax functionality. When i load an external page to a specific div it loads fine. inside the external page there is an .append that .appends javascript to the head. This works on the initial load but when i use .load to load it this portion is not showing. //This is the .load for the div function loadContent(elementSelector, sourceUrl) { url = ""+sourceUrl+""; $(""+elementSelector+"").load(url); alert(url); } //This is the append in the other page that is embedded in a js var cUrl = "http://intensedebate.com/js/genericCommentWrapper2.php?acct="+idcomments_acct+"&postid="+idcomments_post_id+"&title="+idcomments_post_title+"&url="+idcomments_post_url; alert(cUrl); commentScript.type = "text/javascript"; commentScript.src = cUrl; $('head').append(commentScript);

    Read the article

  • jQuery 1.5.1 vs 1.4.4 weirdness

    - by zobgib
    I have been getting some weird errors when I upgrade jQuery from 1.4.4 to 1.5.1. Maybe you guys can explain what I need to change or why the new version is not working. In 1.4.4 I have the following code <div class="navlink home" data-link="home"> <span class="top">Home</span> </div> <div id="index-03"> </div> <div class="navlink resume" data-link="resume"> <span class="top">Resume</span> </div> <div id="index-05"> </div> <div id="index-06"> </div> <div class="navlink portfolio" data-link="portfolio"> <span class="bottom">Portfolio</span> </div> JS: $(".navlink").hover( function () { $(this).delay(100).animate({backgroundPosition: "-100% 0"}, 400); $(this).find("span").css("textDecoration","underline"); }, function () { $(this).queue("fx", []); $(this).animate({backgroundPosition: "0% 0%"}, 400); $(this).find("span").css("textDecoration","none"); } ); Which works just fine. but when I switch jQuery versions by changing this line in my header from <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script> to <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script> The above code quits animating and the background image just disappears. Here is a jsFiddle that shows what's happening just change the jQuery version on the side between 1.4.4 and 1.5.1 http://jsfiddle.net/fUXZ4/ -- 1.4.4 http://jsfiddle.net/3APCd/ -- 1.5.1 Here is a video of exactly what is happening to me: http://img.zobgib.com/2011-03-07_1905.swf

    Read the article

  • Catch all javascript errors and send them to server

    - by ssaboum
    Hi everyone, i wandered if anyone had experience in handling javascript errors globally and send them from the client browser to a server. I think my point is quite clear, i want to know every exceptions, errors, compilation errors, ... that happens on the client side and send them to the server to report them. I'm mainly using mootools and head.js (for the js side) and django for the server side (not that it matters...). Thank you for your help. Regards.

    Read the article

  • Difference between SRC and HREF

    - by Vijey
    The SRC and HREF attributes are used to include some external entities like an image, a CSS file, a html file, any other web page or a javascript file. Is there a clear differentiation between SRC and HREF? where/when to use SRC or HREF? I think they can't be used interchangeably. I'm giving below few examples where these attributes are used: To refer a CSS file: href="cssfile.css" inside the link tag To refer a js file: src="myscript.js" inside the script tag To refer an image file: src="mypic.jpg" inside an image tag To refer another webpage: href="http://www.webpage.com" inside an anchor tag

    Read the article

  • Advantages Of Putting HTML in Javascript

    - by user1609376
    I am wondering if it is better to put your html in javascript or in your html files. For example having my js file have this $('<div>').addClass('test').append( $('<p>').text('test1'), $('<span>').text('test2'), $('<span>').text('test3') ).insertAfter( $('#test1') ); VS My html file looking like this <div id="#test1"></div> <div class="test"> <p>test1</p> <span>test2</span> <span>test3</span> </div> and the js file have: $('.test').show();

    Read the article

  • jQuery image loop not displaying any images

    - by user1871097
    I'm trying to create a very basic image gallery in jQuery. The goal is to have 3 images fade in and out in a sequential order. So image 1 is displayed, fades to image 2 etc. then the whole thing loops again. My HTML code so far is as follows: <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Slider</title> <style type="text/css"> .slider{ width: 2848px; height: 2136px; overflow: hidden; margin: 30px auto; } .slider img{ width:2848px; height:2136px; display:none; } </style> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js"></script> <script src="Slider2.js"></script> </head> <body onload="Slider2"();> <div class="slider"> <img id="1" src="31.jpg" border="0" alt="city"/> <img id="2" src="2vrtigo2.jpg" border="0" alt="roof"/> <img id="3" src="3.jpg" border="0" alt="sea"/> </div> </body> And the jQuery code looks like this: function Slider2() { var total = $(".slider img").size(); for (i=1; i<=total; i+=1) { $(".slider #"+i).fadeIn(600); $(".slider #"+i).delay(2000).hide; }} A quick syntactical note, I've also tried using i++ in the last argument of the For Loop. The result of this code is a blank, white page. I know some of the HTML is being compiled because the enormous 2848x2136 div creates scroll bars on the browser. If anyone could help me out, that would be greatly appreciated. Obviously I'm relatively new to web programming and would love some insight into why this isn't working. Thanks!

    Read the article

  • jQuery: Load body of page into variable

    - by Nathan G.
    I'm using jQuery to load the result of a PHP script into a variable. The script is passed something that the user typed with a GET request. I want to take just what the script spit out into its <body> tag. Here's what I've tried: JS: function loader() { var typed = $('#i').val(); //get what user typed in $.get("script.php", {i: typed}, function(loaded) {dataloaded = loaded;}); alert($(dataloaded).find('body')) } But it just displays [Objec object]. How can I get a useful value that is just the contents of the body of a loaded page? I know the PHP works, I just need the JS. The script echos something like 1!!2 (two numbers separated by two exclamation points). Thanks!

    Read the article

  • drawImage don't work on chrome extention

    - by shrwea
    I use canvas drawImage in popup.html. But it doesn't work. Please advise me. popup.html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> </head> <body> <canvas id="test"></canvas> <script src="test.js"></script> </body> </html> test.js var image = document.createElement("img"); image.src = "test.png"; image.onload = function(){ var canvas = document.getElementById('test'); var ctx = canvas.getContext('2d'); ctx.drawImage(image, 0, 0); }

    Read the article

  • Passing arguments to javascript file, how does it work?

    - by vietean
    From the tutorial ScriptJSONOptions of FirebugLite page, I found the below: Script JSON options It is possible to set options using a JSON object inside the linked script: <script type="text/javascript" src="https://getfirebug.com/firebug-lite.js"> { overrideConsole: false, startInNewWindow: true, startOpened: true, enableTrace: true } </script> It means that we can pass the arguments to javascript file. But I don't know how does it work? Update: My question is how to get the arguments inside the js file? P/S: I also looked into code, but I could not find the code is implemented this feature.

    Read the article

  • Making application menus on top of gnome shell

    - by GAP
    Is there a way to put gnome shell components (panel, message tray) to be appear below the popup menu's of other applications such as Java and Gtk Apps. The problem is when there are gtk apps which has tray icons the popup menu tends to appear below the message tray, this was bit ok now in 3.6 because the message tray hides soon as the icon is clicked. But the top bar is still a problem for large menus. When running eclipse with lot of options in the context menu the top most items including the scroll button are under top bar. Is there any thing i can change in the main.js or panel.js to get things below the popup menus ?

    Read the article

  • How to retrieve value from asp.net textbox from javascript?

    - by Clean
    Hi, I have an asp.net web form with a couple of asp.net textbox controls: <asp:TextBox ID="txtTextBox" runat="server" /> . I have a javascript file tools.js that are included in the page: <script src="tools.js" type="text/javascript"></script> How can I access the value from txtTextBox from javascript? Ive tried using document.getElementById('<%= txtTextBox.ClienID %>').value; document.getElementById('<%= txtTextBox.UniqueID %>').value; document.getElementById('<%= txtTextBox %>').value; but none of them works. Any ideas?

    Read the article

  • Whats the best way of using MVC + ajax (jquery) to load page content, aspx or ascx or both

    - by devzero
    I want to have a menu that when I click replaces the content of a "main" div with content from a mvc view. This works just fine if I use a .aspx page, but any master.page content is then doubled (like the and any css/js). If I do the same but uses a .ascx user control the content is loaded without the extras, but if any browser loads the menu item directly (ie search bot's or someone with JS disabled), the page is displayed without the master.page content. The best solution I've found so far is to create the content as a .ascx page, then have a .aspx page load this if it's called directly from the menu link, while the ajax javascript would modify the link to use only the .ascx. This leads to a lot duplication though, as every user control needs it's own .aspx page. I was wondering if there is any better way of doing this? Could for example the master.page hide everything that's not from the .aspx page if it was called with parameter ?ajax=true?

    Read the article

  • (Rails) How do I reference resources from non-restful views...?

    - by humble_coder
    Hi All, How do you ensure that your javascript includes get included properly for all files everywhere using a particular layout? Basically I have some non-restful actions that I've added. I haven't added any ROUTES for them, however, using normal text rendering works fine. It's when I start requiring different "swf" and "js" files (files which are properly placed in PUBLIC) that things get hairy. I start receiving "406 Not Acceptable" errors telling me that it's looking for the files in a subdirectory of the current controller. As it stands I'm in including the JS in "application" layout file. It works for the INDEX action, but doesn't seem to work for any of the non-restful actions. Thoughts?

    Read the article

  • What are the differences in performance between synchronous and asynchronous JavaScript script loading?

    - by jasdeepkhalsa
    My question is simply: what are the differences in performance between synchronous and asynchronous JavaScript script loading? From what I've gathered synchronous code blocks the loading of a page and/or rest of the code from executing. This happens at two levels. First, at the level of the script actually loading, and secondly, within the JavaScript code itself. For example, on the page: Synchronous: <script src="demo_async.js" type="text/javascript"></script> Asynchronous: <script async src="demo_async.js" type="text/javascript"></script> And within a script: Synchronous: function a() {alert("a"); function b() {alert("b");}} Asynchronous (and self-executing): (function(a, function(b){ alert(b); }) { alert(a); }))(); So what really is the difference in performance from using these different loading methods and JavaScript patterns?

    Read the article

  • Fade out menu doesn't work in IE8

    - by user1787488
    I used this script in my website. But it doesn't work in IE8 or lower versions. Is it possible to work perfectly in all browsers? <script type="text/javascript" src="/web/upload/js/jquery-1.3.2.js"></script> <script type="text/javascript"> $(function() { $(window).scroll(function(){ var scrollTop = $(window).scrollTop(); if(scrollTop != 0) $('#header').stop().animate({'opacity':'0'},400); else $('#header').stop().animate({'opacity':'1'},400); }); $('#header').hover( function (e) { var scrollTop = $(window).scrollTop(); if(scrollTop != 0){ $('#header').stop().animate({'opacity':'1'},400); } }, function (e) { var scrollTop = $(window).scrollTop(); if(scrollTop != 0){ $('#header').stop().animate({'opacity':'0'},400); } } ); }); </script>

    Read the article

  • Can't get jQuery ajax work

    - by yozloy
    I'm new to jQuery, and it really cool, but I can't get the basic ajax work, there's no error in the console ,so I don't know where goes wrong: getJSON function version: $(document).ready(function(){ $.getJSON('http://pollview:8888/js/example.json', function(data){ for(var element in data){ console.log(data[element]); } }); }); then the basic ajax version: $(document).ready(function(){ $.ajax({ url: 'http://pollview:8888/js/example.json' }).done(function(data){ alert('successful'); }); }); I get me stuck, any idea?

    Read the article

  • Do i need a hashtag in Javascript to pass as a Div

    - by Mike
    How do i insert this php DivSomething into Javascript? Since Javascript needs a hashtag to recognize that as a div. Is there a way to tell JS that this is a Div or there's other better way to do it? Any help would be very much appreciated. <script> /*How do i insert a var DivSomething into JS with a hashtag */ /* DivSomething is php dynamic. It returns a Div. It can be #Div1, #Div2, #Div3... */ var DivSomething = '<?php echo $Highlight; ?>' $(function() { $('#MouseHere').hover(function() { $('#' + DivSomething).css('background-color', '#ffffff'); }, function() { // on mouseout, reset the background colour $('#' + DivSomething).css('background-color', ''); </script>

    Read the article

  • Missing } in XML expression

    - by Chris
    I have an external javascript file that I want to, upon include, write some HTML to the end of the web page. Upon doing so though I get the error Missing } in XML expression on the line that uses dropdownhtml. Here is my code var dropdownhtml = '<div id="dropdown"></div>'; $(document).ready(function(){ //$(document).append(dropdownhtml); alert(dropdownhtml); }); The XHTML webpage that includes this file does so like this: <script type="text/javascript" src="/web/resources/js/dropdownmenu.js"></script> Doing either append or alert throws up the same error, what is going wrong?

    Read the article

  • ajax request internal server error

    - by joe
    Everything is working good on local but when i try same codes in production, i get 500 (Internal Server Error) error. entries.controller def set_spam @entry = Entry.find(params[:entry_id]) @entry.spam = params[:what] == "spam" ? true : false @entry.save respond_to do |format| format.js end end application.js $(".entry-actions .spams img").click(function () { $.post("/set-spam", { entry_id: $(this).attr("entry_id"), what: $(this).attr("class") } ); return false; }); view <div class="spams"> <img title="spam" class="spam" src="/images/pixel.gif" entry_id="<%= entry.id %>" /> </div> route post "/set-spam" => "entries#set_spam"

    Read the article

  • Why does `Array.length`, `Function.length`, `String.length`, etc return 1?

    - by zealoushacker
    While teaching my JavaScript class yesterday, my students and I came across some interesting functionality that I thought might be worth capturing in a question and the answer I've come to. Typing Array.length in the JS console in chrome returns 1. Likewise, Function.length returns 1. This is important because: Every function in JavaScript is actually a Function object. (MDN JS Ref: Function) Thus, Object.length and likely all other native objects will and should return 1 as the value of the length property. So, finally why is this behavior occurring?

    Read the article

  • How would one dynamically load Javascript that has been parsed as PHP?

    - by beatsforthemind
    I am looking to dynamically load javascript that has been parsed as PHP so that I will be able to pass PHP variables to javascript, and then load this file into the primary PHP document. I have a document called myscript.js.php that includes the javascript and PHP. I attempted to load it into the primary document using jQuery's getScript like this: $.getScript("myscript.js.php", function() { alert('loaded script.'); }); This attempt failed - I am assuming because of the .php extension on the file. Is there anyway to dynamically load javascript that includes PHP? I have a few session variables that I am looking to pass through javascript that will be updated frequently, creating a need for the javascript to be reloaded.

    Read the article

< Previous Page | 130 131 132 133 134 135 136 137 138 139 140 141  | Next Page >