Search Results

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

Page 27/309 | < Previous Page | 23 24 25 26 27 28 29 30 31 32 33 34  | Next Page >

  • Showing popup in the new FB JS SDK

    - by FearUs
    HI, I used to have an Href in my website, when users clicked on it, multi friend selector showed so they can incite their friends to my website. That was done using the following code: FB.ensureInit(function() { var dialog = new FB.UI.FBMLPopupDialog('XXXXXXX', ''); var fbml = 'Multi-Friend-Selector FBML' dialog.setFBMLContent(fbml); dialog.setContentWidth(620); dialog.setContentHeight(570); dialog.show(); }); Now, I'm using the new JS SDK (http://connect.facebook.net/en_US/all.js), but the old methods are not present... How can I do it with the new SDK ??

    Read the article

  • How to render partial.js in rails 3

    - by julian-mann
    Using rails3 - I have a project with many tasks. I want to use javascript to build the UI for each task. I figured I could display those tasks on the projects show page by rendering a javascript partial for each. I can't get 'tasks/show' to see tasks/show.js.erb Any ideas? In projects/show.html.erb <div id="tasks"> <%= render(:partial => "tasks/show", :collection => @project.tasks) %> </div> tasks/show.js.erb $("tasks").append(new TaskWidget(task.id)) I get the errors ActionView::MissingTemplate in Projects#show Missing partial tasks/show with {:handlers=>[:erb, :rjs, :builder, :rhtml, :rxml], :formats=>[:html], :locale=>[:en, :en]} in view paths .... around line #13 Thanks

    Read the article

  • Good code highlighting, syntax analysis and code assist editor on js.erb and css.erb files

    - by Pickachu
    I want to know if there is a good compatible api that supports erb and javascript highlighting. I've already tried Eclipse with Aptana RadRails. Perhaps I'm configuring something wrong, but it guesses that I'm using html.erb on both css.erb and js.erb files. I've tried too the Emacs with js2-mode, nXhtml and Rinari modes. Again, it works fine for html.erb, but it detects the css.erb and js.erb as html.erb files. Maybe it's possible to configure it to accept that files and be compatible.

    Read the article

  • Drupal adding JS

    - by Andrew
    I know this is not a Drupal forum but this forum is quick at responding so I thought I should give it a shot. Here's my problem. I'm trying to insert reference to the javascript file in the header by using drupal_add_js function. I placed this line inside template preprocess function of template.php. The result....is not working at all. There is no script link in output as it should be. Can anyone tell me what am I doing wrong? Drupal Version - 6x function phptemplate_preprocess_page(&$vars) { $url = drupal_get_path("theme","mysite"); drupal_add_js($url."/jquery.js"); drupal_add_js($url."/drupal.js"); .....

    Read the article

  • SharePoint Lookup Field 20 Item JS error

    - by Chops
    Hi Everyone, I've got an issue with SharePoint Server 2007 SP1 which seems to be documented in various forms, but I haven't been able to find an answer to my seemingly simpler question. http://social.msdn.microsoft.com/Forums/en-US/sharepointcustomization/thread/040533d2-c738-4ac2-b2d6-65a1602fa2d1 Essentially, we have a form with a lookup field to another SharePoint list. The lookup field has more than 20 items, and so SharePoint changes the type/behaviour of the field as per the standard behaviour. However, with my custom skin applied, clicking on this drop down causes a JS error from within the Core.js file, as described here: http://splitnut.blogspot.com/2009/06/lookup-fields-in-moss-javascript-error.html What I haven't been able to figure out is why this is only an issue when my custom master page is applied, and not the OOTB master pages. I've been through and tried to see what might cause this, but haven't been able to track down the cause of the behaviour. Any help would be much appreciated. Many thanks.

    Read the article

  • Multiple JS effects on one event

    - by Cylindric
    I've got a bunch of Ajax links in a menu that reload a div called #ajaxupdatediv. I want to display another div while that's loading the new content, so how would I fire off both effects? <div id="#ajaxupdatediv"> Content will go here </div> <div id="ajaxloadingdiv"> ...Loading... </div> Here's a bit of the PHP array( 'update' => '#ajaxupdatediv', 'before' => $this->Js->get('#ajaxupdatediv')->effect('fadeOut'), 'complete' => $this->Js->get('#ajaxupdatediv')->effect('fadeIn'), )

    Read the article

  • Getting started with Express - Error: Cannot find module './routes'

    - by Enrico Tuttobene
    I am just getting started in the world of Node.JS, and I tried using the command line "express" command to install a basic application (with jade support) Now, I was playing around with it a bit to see how it works and I am coming across a strange error: In the /routes directory there is a file called index which contains exports.index = function(req, res){ res.render('index', { title: "Express" }); }; that, as you all know, renders the index page. Well, all I did was renaming that file from index.js to router.js, so that I can easily refer to it as I would like to have more than just an index page. The renaming doesn't work, I get the error Error: Cannot find module './routes' Which is weird, as I though that var express = require('express'), routes = require('./routes'); would require ALL the files in the directory. There must be something small there I'm missing, and please bare with me as I am pretty new to this. Thanks in advance.

    Read the article

  • How to Pass a JS Variable to a PHP Variable

    - by dmullins
    Hello: I am working on a web application that currently provides a list of documents in a MySql database. Each document in the list has an onclick event that is suppose to open the specific document, however I am unable to do this. My list gets popluated using Ajax. Here is the code excerpt (JS): function stateChanged() { if (xmlhttp.readyState==4) { //All documents// document.getElementById("screenRef").innerHTML="<font id='maintxt'; name='title'; onclick='fileopen()'; color='#666666';>" + xmlhttp.responseText + "</font>"; } } } The onclick=fileopen event above triggers the next code excerpt, which downloads the file (JS): function stateChanged() { if (xmlhttp.readyState==4) { //Open file var elemIF = document.createElement("iframe"); elemIF.src = url; elemIF.style.display = "none"; document.body.appendChild(elemIF); } } } Lastly, the openfile onclick event triggers the following php code to find the file for downloading (php): $con = mysql_connect("localhost", "root", "password"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("Documents", $con); $query = mysql_query("SELECT name, type, size, content FROM upload WHERE name = NEED JS VARIABLE HERE"); $row = mysql_fetch_array($query); header ("Content-type: ". $row['type']); header ("Content-length: ". $row['size']); header ("Content-Disposition: attachement; filename=". $row['name']); echo $row['content']; This code works well, for downloading a file. If I omit the WHERE portion of the Sql query, the onclick event will download the first file. Somehow, I need to get the screenRef element text and change it into a variable that my php file can read. Does anyone know how to do this? Also, without any page refreshes. I really appreciate everyone's feedback and thank you in advance. DFM

    Read the article

  • JS Url GET vars - problem with encoding

    - by Martin
    Hey there! I'm having a bit of trouble here and I was hoping someone throws me a hint :) I'm getting some GET VARS with JS but I have trouble with non-latin charsets: cyrillic for example. The cyrillic var appears correct in the url but when I retrieve it with JS I get some dummy string. I was wondering of a function similar to "unescape" for such a case. Alternatively, if someone knows a way I could convert a cyrillic string to the same dummy string I get from the URL, it will still do me the trick, since all I need is compare. :) Thanks! Martin

    Read the article

  • Checking for Value in JS Object

    - by pagewil
    I have a JS Object like so: var ob{ 1 : { id:101, name:'john', email:'[email protected]' }, 2 : { id:102, name:'jim', email:'[email protected]' }, 3 : { id:103, name:'bob', email:'[email protected]' }, } I want to check if this JS object already contains a record. If it doesn't then I want to add it. For example. if(ob contains an id of 101){ //don't add john }else{ //add john } Catch my drift? Pretty simple question. I just want to know the best way of doing it. Thanks Guys! W.

    Read the article

  • SpineJS and RequireJS

    - by ot3m3m
    I am using require.js 2.0. I have the following code that is called initially by require: app.js requirejs.config({ paths: { app: '..', spine: 'spine_src/spine', cs: "cs", }, shim: { 'spine_src/route': { deps: ['spine'] } } }); // Start the main app logic. requirejs(['cs!app/StartApp_Admin', 'spine','spine_src/route'], function (StartApp_Admin, Spine, Route) { { new StartApp_Admin(); } }); And the following controller: StartApp_Admin define () -> class StartApp_Admin extends Spine.Controller constructor: -> @routes "/twitter/:id": (params) -> console.log("/users/", params.id) Spine.Route.setup() When I execute the application I get the following error in my spine route library file (route.js). The application breaks when I call Spine.Route.setup() Uncaught TypeError: Object function (element) {return element;} has no method 'extend' Any help would be greatly appreciated

    Read the article

  • whJavaScript: how to create a JS event that requires 2 seperate JS files to be loaded first while d

    - by Teddyk
    I want to perform asynchronous JavaScript downloads of two files that have dependencies attached to them. function addScript(url) { var script = document.createElement('script'); script.src = url; document.getElementsByTagName('head')[0].appendChild(script); } addScript('http://google.com/gmaps.js'); addScript('http://jquery.com/jquery.js'); function requiresJQuery() { ... } function requiresGmaps() { ... } function requiresBothJQueryGmaps() { ... } // do some work that has no dependencies on either JQuery or Google maps ... // now call a function that requires Gmaps to be loaded if (GmapsIsLoaded) { requiresGmaps(); } // then do something that requires both JQuery & Gmaps (or wait until they are loaded) if (JQueryAndGmapsIsLoaded) { requiresBothJQueryGmaps(); } Question: How can I create an event to indicate when: JQuery is loaded? Google Maps is loaded JQuery & Google Maps are both loaded?

    Read the article

  • Set a js variable in a html include

    - by user102533
    I have a ASP.NET page that uses the include method for header. I am adding a JS variable that I access from JS functions In head.htm <script language="javascript" type="text/javascript"> var render=<%= RenderProperty %>; </script> The RenderProperty is a method in the base page class (a .cs file that inherits from System.Web.UI.Page) It looks something like this: private bool _renderProp = false; public bool RenderProperty { get { return _renderProp; } set { _renderProp = value; } } On a page by page basis, I set the RenderProperty in the Page_Load of a aspx page protected void Page_Load(object sender, EventArgs e) { RenderProperty = true; } I get a compile time error that says: The name 'RenderProperty' does not exist in the current context C:\...\head.htm

    Read the article

  • Minifying CSS, JS, and HTML - together

    - by Radu
    Minifying JS and CSS is quite common. The benefits of minifying JS are much greater that those seen with CSS because with CSS you can't rename elements - and same goes for HTML. But what if all 3 were minified together so that the benefits of using shorter names can be brought to CSS and HTML? That is, instead of minifying without any regard to the relationships between the 3, these could be preserved and made simpler. I imagine that the implementation could be quite difficult but if it were possible, do you think it would provide a significant advantage over traditional minification?

    Read the article

  • Always require a plugin to be loaded

    - by axon
    I am writing an application with RequireJS and Knockout JS. The application includes an extension to knockout that adds ko.protectedObservable to the main knockout object. I would like this to always be available on the require'd knockout object, and not only when I specify it in the dependencies. I could concat the files together, but that seems that it should be unnecessary. Additionally, I can put knockout-protectedObservable as a dependency for knockout in the requirejs shim configuration, but that just leads to a circular dependency and it all fails to load. Edit: I've solved me issue, but seems hacky, is there a better way? -- Main.html <script type="text/javascript" src="require.js"></script> <script type="text/javascript"> require(['knockout'], function(ko) { require(['knockout-protectedObservable']); }); </script> -- knockout-protectedObservable.js define(['knockout'], function(ko) { ko.protectedObservable = { ... }; });

    Read the article

  • Images with razor asp.net mvc inside JS

    - by sarsnake
    I need to dynamically insert an image in my JS code. In my Razor template I have: @section Includes { <script type="text/javascript"> var imgPath = "@Url.Content("~/Content/img/")"; alert(imgPath); </script> } Then in my JS I have: insertImg = ""; if (response[i].someFlag == 'Y') { insertImg = "<img src=\"" + imgPath + "/imgToInsert.gif\" width=\"6px\" height=\"10px\" />"; } But it doesn't work - it will not find the image. The image is stored in /Content/img folder... What am I doing wrong?

    Read the article

  • Are Ext JS files necessary in a working site?

    - by songdogtech
    I've inherited a high-traffic site that loads some Ext javascript files and I'm trying to trim some bandwidth usage. Are Ext libraries necessary for development only or are they required for the finished site (I've never used Ext.) The site loads ext-base.js, ext-all-debug.js, expander.js, exteditor.js. It appears that expander.js and exteditor.js have some site specific code, so they should stay? But what about ext-base.js and ext-all-debug.js? Am I reading this correctly - are base and debugging libraries necessary for a live site?

    Read the article

  • form_for [@parent,@son],:remote=>true not asking for JS

    - by Cibernox
    Hi. I have a plain old form. That form is used to create new objects of a nested model. #restaurant.rb has_many :courses #courses.rb belongs_to :restaurant #routes.rb resources :restaurants do resources :courses end In my views(in haml), i have that code: %li.course{'data-random'=>random} = form_for([restaurant,course], :remote=>true) do |f| .name= f.text_field :name, :placeholder=>'Name here' .cat= f.hidden_field :category .price= f.text_field :price,:placeholder=>'Price here' .save = hidden_field_tag :random,random = f.submit "Save" I espected that form to be answered by action create of courses_controller with JS (create.js.erb), but it is submited like a normal form, and is answered with html. What am I doing wrong? This problem is similar to this but the only answer don't make sense to me. Thanks Inside

    Read the article

  • How can I set breakpoints in an external JS script in Firebug

    - by Manu
    I can easily set breakpoints in embedded JS functions, but I don't see any way of accessing extarnal JS scripts via Firebug unless I happen to enter them during a debug session. Is there a way to do this w/o having to 'explore' my way into the script? @Jason: This is a good point, but in my case I do not have easy access to the script. I am specifically talking about the client scripts which are invoked by the ASP.Net Validators that I would like to debug. I can access them during a debug session through entering the function calls, but I could not find a way to access them directly.

    Read the article

  • Is it possible to run node script from a web page as differnt user?

    - by Blame
    I'am searching for days now but could not get an answer. I would like to do the following: User connects to editor.html (Apache2 with basic http auth) User want to open a file on the server with his user/pass (same as in passwd) Node.js Script gets startet with user rights from above and user can edit file The Node Script will handly the connection via websockets and read/writes files. I think the biggest problem is that its not possible to run a node script on the server from a web page... and I don´t want to involve any php/cgi scripts... only Apache and Node.js / JS. Please also comment or answer if you know that it is really not possible... Thanks! Kodak

    Read the article

  • Specifying routes by subdomain in Express using vhost middleware

    - by user730569
    I'm using the vhost express/connect middleware and I'm a bit confused as to how it should be used. I want to have one set of routes apply to hosts with subdomains, and another set to apply for hosts without subdomains. In my app.js file, I have var app = express.createServer(); app.use...(middlware)... app.use(express.vhost('*.host', require('./domain_routing')("yes")); app.use(express.vhost('host', require('./domain_routing')("no")); app.use...(middlware)... app.listen(8000); and then in domain_routing.js: module.exports = function(subdomain){ var app = express.createServer(); require('./routes')(app, subdomain); return app; } and then in routes.js I plan to run sets of routes, dependent on the subdomain variable passed in is "yes" or "no". Am I on the right track or is this not how you use this middleware?

    Read the article

< Previous Page | 23 24 25 26 27 28 29 30 31 32 33 34  | Next Page >