Search Results

Search found 9897 results on 396 pages for 'facebook social plugins'.

Page 136/396 | < Previous Page | 132 133 134 135 136 137 138 139 140 141 142 143  | Next Page >

  • Developing a jQuery plugin that returns a given object, instead of jQuery object itself!

    - by mehdi5275
    Hi, Consider the following base code: (function($) { $.fn.myPlugin = function(settings) { return this.each(function() { //whatever }); }; }); The plugin returns a jQuery object. The question is how am I supposed to write a plugin that returns a custom object so that I can do something like this: var api = $('div.myelement').myPlugin(); api.onMyEventName(function(e, whateverParam) { //whatever }); It'd be highly appreciated if you could write some lines of code that describes me how to do that, how to call the onMyEventName function on a custom api object... Thanks.

    Read the article

  • jQuery validation plugin for two fields

    - by jonathan p
    I am using the Jquery Validation plug-in, however i need to add a "custom rule", i have 2 date fields and i need to ensure that the end date is not less than the start date. My problem is how to pass the two fields in as elements. As i understand u set up a custom function something like this : function customValidationMethod(value, element, params){ } But can't see how i could use it with two fields, if anyone has any ideas it would be greatly appreciated.

    Read the article

  • typeof for html plugin elements

    - by gf
    When using ECMAScripts typeof on plugin elements (i.e. embed or object), Safari & FireFox return "function": typeof(window.document['myPlugin']) // "function" This can't be influenced on the plugin side, as the browser doesn't call the plugin here. Funny enough, in IE the same line evaluates to "object". Is that simply implementation dependent behaviour as per ECMAScript §11.4.3 or am i missing something here?

    Read the article

  • Plugin methods are missing in Firefox 3.6

    - by splintor
    Hi, We have a plugin that we use to enable printing and saving from our app. We instantiate it using tag with all needed attributes, and then call Save() or Print() method on the document.embeds[0] object. This used to work perfectly on Firefox 3.5 and earlier, but it no longer works in Firefox 3.6. In 3.6, document.embeds[0].Save is null, that is our custom methods are not defined on this object. Any idea why this happens, and what has changed in Firefox 3.6 that causes it? Any idea on how to debug it and find the cause? And most important, any idea of a workaround that will allow us to access this methods? Thanks, splintor

    Read the article

  • To be a lazy developer or not to be a lazy developer?

    - by JamesStuddart
    Am I a lazy developer? Is it being lazy to use automated tools, such as code generators and such? Now, I could, if I had to, create all the data layers and entities I needed, but I choose to use CodeSmith to generate my datalayers and entities. I also use Resharper and I would say it fights with MSDeploy as to which gets installed first after Visual Studio. Again if I had to, I could code without it, but prefer not to. Both these tools from my point of view are no brainers as they improve output massively. But is this lazy? I'm sure there are purists out there that would say everything should be wirtten by you so you know what everything is doing, but if you can read through the code and see what is happening is that ok? So am I being lazy or am I just using all the cards in my hand?

    Read the article

  • will_paginate without use of activerecord

    - by truthSeekr
    I apologize if this is a trivial question or my understanding of rails is weak. I have 2 actions in my controller, index and refine_data. index fetches and displays all the data from a database table. refine_data weeds out unwanted data using regex and returns a subset of the data. Controller looks like: def index Result.paginate :per_page => 5, :page => params[:page], :order => 'created_at DESC' end def refine_data results = Result.all new_results = get_subset(results) redirect_to :action => 'index' end I would like to redirect the refine_data action to the same view (index) with new_results. As new_results are not from the database table (or model), how do I go about constructing my paginate?

    Read the article

  • jquery: call functions immediately after plugin

    - by Dave
    I'm sure that there's an easy answer to this, but I can't find it. I have a table 'myTable' which I stripe using the following $("#myTable tr:even").css({ "background-color": "#FEE996" }); $("#myTable tr:odd").css({ "background-color": "#FFEFAF" }); This works fine. I am also using a table filter plugin as follows $('#myTable').tableFilter(); This plugin places a blank field at the top of each column into which the filter criteria can be typed. When the table is filtered it removes unmatched rows, which in turn messes up the striping. I would like to be able to re-invoke the lines to re-stripe the table. Something like $('#myTable').tableFilter().find("tr:even").css({ "background-color": "#FEE996" }).find("tr:even").css({ "background-color": "#FFEFAF" }); Is this possible please?

    Read the article

  • Self Executing jQuery Plugin?

    - by GnrlBzik
    I am working on expansion of my jQuery plug-in authoring knowledge, just playing around with my own ideas for learning benefits. So i was wondering how you guys tackle the need of plugin executing without any user specific input. So I have a need for plug-in that executes right away after document is ready, without any user's specific input just as long as doc is loaded, so the only way I see how to execute plug-in on it's own is to attach handler to ready listener that executes my function which I extended the jQuery with. And because this needs to be self enclosed, part of the code, I attach handler to event listener within the function. So how else could one tackle this? Any take at this is appreciated. Thank you in advance everyone.

    Read the article

  • jQuery colorbox plugin isn't loading inline content

    - by Summer
    Hi, I'm trying to use the jQuery colorbox plugin to show a little warning when a warning icon is clicked. Check out the problem: - Go to http://dev.imagineelection.com/browse/zip/10011 - Click on one of the warning icons (scroll down to see one). See how the colorbox that pops up is empty? I've tried to isolate the problem: - If you click "View Source" -- the div id="address-alert" is in there - If you click "View Generated Source" (for example, with Firefox Web Developer plugin) -- the div id="address-alert" has been taken out, but it has not been replaced inside the new div id="cboxCurrent" that colorbox has put at the top of the page The jQuery call I'm doing is: if (jQuery().colorbox) { $(".warning-class").colorbox({width:"50%", inline:true, href:"#address-alert"}); } What is going on? Why won't the inline content work?

    Read the article

  • Cross-platform general purpose C++ RPC library

    - by iUm
    Here's the task: Imagine, we have an applications and a plug-in for it (dynamic library). Interface between the application and the plug-in is completely defined. Now I need to run the application and the plug-in on different computers. I wrote a stub for the plug-in on a computer where the real applications is running. And the application loads it and calls its functions like if it were a native plug-in. On the other computer there's a stub instead of the real application, which loads the native plug-in. Now I need to organize RPCs between my stubs over the network, regardless the very transport. Usually, it's not difficult. But there're some restrictions: Application-plug-in interaction can be reenterable (e.g. application calls f1() from plug-in, in f1() plug-in calls g1() from application, in g1() application calls f2() from plug-in and so on...) Any such reenteration should be executed exactly by the same thread, which started the sequence Where can I find a cross-platform C++ RPC library with such features?

    Read the article

  • How to create a new ID for the new added node?

    - by marknt15
    Hi, I can normally get the ID of the default tree nodes but my problem is onCreate then jsTree will add a new node but it doesn't have an ID. My question is how can I add an ID to the newly created tree node? What I'm thinking to do is adding the ID HTML attribute to the newly created tree node but how? I need to get the ID of all of the nodes because it will serve as a reference for the node's respective div storage. HTML code: <div class="demo" id="demo_1"> <ul> <li id="phtml_1" class="file"><a href="#"><ins>&nbsp;</ins>Root node 1</a></li> <li id="phtml_2" class="file"><a href="#"><ins>&nbsp;</ins>Root node 2</a></li> </ul> </div> JS code: $("#demo_1").tree({ ui : { theme_name : "apple" }, callback : { onrename : function (NODE, TREE_OBJ) { alert(TREE_OBJ.get_text(NODE)); alert($(NODE).attr('id')); } } }); Cheers, Mark

    Read the article

  • Problems re-populating select options in Rails when form returned with errors

    - by Rick
    I have a form with 2 select options in it -- frequency and duration. When there are errors with the form, and it is returned to the browser, the select options are not re-populated with the selections the user made even though the returned values for those fields match the values of options in the selects. Also, when the form is returned, these fields are not marked as having errors even though their values are blank. Here's the frequency and duration fields in Rails <%= frequency_select c, :frequency %> <%= duration_select c, :duration %> The method for frequency_select is def frequency_select(f, method) options = [["day", 1.day], ["other day", 2.days], ["week", 1.week]] f.select method, options, :include_blank => true end And the method for duration_select is def duration_select(f, method, unit="day" ) values, units = *case unit when "day" : [[[5, 5], [15, 15], [30, 29]], "days"] when "other day" : [[[15, 15], [30, 29], [45,45]], "days"] when "week" : [[[4, 29], [6, 43], [8, 57]], "weeks"] end f.select method, values.map {|(label, i)| ["#{label} #{units}", i.days]}, :include_blank => true end If you enter a value into one or both of these fields and submit the form without completing part of it (any part of it), the form is returned to the user (as would be expected), but the duration and frequency fields are not re-populated with the user's selection. If I add this bit of code to the form <p><%= @challenge.attributes.inspect %></p> I see that this for duration and frequency when the form is returned to the browser: "duration"=>3888000, "frequency"=>172800 These values match values on the options in the select fields. Is there anything special in Rails that needs to be done so that the select fields are re-populated with the user's selections? Any thoughts on what the problem could be or what I should try next? Help is greatly appreciated! -Rick PS If you look at some of the other questions, you'll notice I've asked about this in the past. At one point, I thought the form was returning values for frequency and duration in days rather than seconds, but that's not the case. PPS Here's one other bit of information that might matter, but my tests indicate that it probably does not. (Though, I'm a bit of a newbie to this, so don't take my word for it.) These two fields are chained together using the cascade jquery plugin. The javascript is included on the page (not in a separate file) and some of the js is being created by Rails. First, here are the scripts as they appear in the browser. The first is the script to generate the options for the duration select and the second is the script required by the Cascade plugin to trigger the field chaining. <script type="text/javascript"> var list1 = [ {'When':'86400','Value':' ','Text':' '}, {'When':'172800','Value':' ','Text':' '}, {'When':'604800','Value':' ','Text':' '}, {'When':'86400','Value':'432000','Text':'5 days'}, {'When':'86400','Value':'1296000','Text':'15 days'}, {'When':'86400','Value':'2505600','Text':'30 days'}, {'When':'172800','Value':'1296000','Text':'15 days'}, {'When':'172800','Value':'2505600','Text':'30 days'}, {'When':'172800','Value':'3888000','Text':'45 days'}, {'When':'604800','Value':'2505600','Text':'4 weeks'}, {'When':'604800','Value':'3715200','Text':'6 weeks'}, {'When':'604800','Value':'4924800','Text':'8 weeks'} ]; function commonTemplate(item) { return "<option value='" + item.Value + "'>" + item.Text + "</option>"; }; function commonMatch(selectedValue) { return this.When == selectedValue; }; </script> <script type="text/javascript"> jQuery(document).ready(function(){ jQuery("#challenge_duration, #user_challenge_duration").cascade("#challenge_frequency, #user_challenge_frequency",{ list: list1, template: commonTemplate, match: commonMatch }) }); </script> And here's a bit of the the first script as it is in the erb file -- you see that some of the script is being generated by Rails <%= [ [1.day, [[5, 5], [15,15], [30, 29]], "days"], [2.days, [[15, 15], [30, 29], [45, 45]], "days"], [1.week, [[4, 29], [6, 43], [8, 57]], "weeks"]].map do |(frequency, durations, unit)| durations.map do |(label, value)| "{'When':'#{frequency}','Value':'#{value.days}','Text':'#{label} #{unit}'}" end end.join(",\n") -%> Now, the reason I don't think that it matters whether the duration is being generated with JS is the problem still exists if I remove all the JS the problem also affects the frequency field, whose options are not being generated by the JS

    Read the article

  • How can I move windows in Windows with keyboard? [closed]

    - by nestling
    I recently started using Linux and was floored by the ease with which windows can be moved and resized with simple keyboard combinations using Compiz. If I want to move a terminal to top-right of the screen a simple CTRL+ALT+Numpad9 does the trick for me, and it resizes the window at the same time. I'm sure you guys know what I'm talking about. I would like to know if there is a way to do this in windows. Thanks.

    Read the article

  • Track Users of Website With JQuery Plugin

    - by grungefreak1
    Hi, Is there a way to track users of my site (based on Session ID's) using JQuery? I would like to know what pages and how long they spent on each page for example. Or any other suggestions are welcome. I had tried this with Google Analytics but I cannot seem to track individual users based on an ID. GF

    Read the article

  • Image gallery with a Lightbox in jQuery

    - by Alex
    Hi. I'd like to create a jQuery image gallery of showcased products. It will show one product image at a time, with Next/Previous arrows, and a brief name and price as overlay on the image. If users click it, it will go to the order page. It will have an icon to show a larger, modal version (Lightbox style) of the image with full description, price, and a link to a page to order it. In other words, it's an inline gallery, about 250px X 150px, with next/previous option, but also with a little icon to fire it up in a lightbox type modal window that can have links. Here's an example which doesn't have the inline gallery effect. Here's another, also missing the inline gallery. Is there such a beast as what I'm looking for? Thanks.

    Read the article

  • how to disable vim autocomplete popup for plain text files?

    - by doorfly
    After literally days of tweaking, I think I got vim's autocomplete (omnicomplete + Acp plugin) to work acceptably. But the annoying thing is that it is still enabled for plain text files so I would have to type :DisableAcp for README or plain text files. How do I add logic to my vimrc so that if it detects an empty filetype it disables the Acp on startup? here is what I wrote: if &filetype == "" let g:acp_enableStartup = 0 endif but this disables Acp on start up for all files.

    Read the article

  • Query select field on JqGrid edit form

    - by abuzuhair
    I have this colom Model on JqGrid: {name:'ta',index:'ta',jsonmap:'ta',width:70,editable:true,edittype:'select', editoptions: {dataUrl:hostname+'/sisfa/ta_cb'}} I am using JqGrid form editing to edit this field. How to 'catch' the field editor for this field on form editing. I'm using this method, but not work .editGridRow("new", {closeAfterAdd: true, addCaption:'Add Data', width:500,dataheight:300,beforeShowForm:function(formid){ console.log($('#tr_ta').find('select[name=ta]')); }}); This method work for other edittype.

    Read the article

  • Ruby on Rails controller and architecture with cells

    - by dt
    I decided to try to use the cells plugin from rails: http://cells.rubyforge.org/community.html given that I'm new to Ruby and very used to thinking in terms of components. Since I'm developing the app piecemeal and then putting it together piece by piece, it makes sense to think in terms of components. So, I've been able to get cells working properly inside a single view, which calls a partial. Now, what I would like to be able to do (however, maybe my instincts need to be redirected to be more "Rails-y"), is call a single cell controller and use the parameters to render one output vs. another. Basically, if there were a controller like: def index params[:responsetype] end def processListResponse end def processSearchResponse end And I have two different controller methods that I want to respond to based on the params response type, where I have a single template on the front end and want the inner "component" to render differently depending on what type of request is made. That allows me to reuse the same front-end code. I suppose I could do this with an ajax call instead and just have it rerender the component on the front end, but it would be nice to have the option to do it either way and to understand how to architect Rails a bit better in the process. It seems like there should be a "render" option from within the cells framework to render to a certain controller or view, but it's not working like I expect and I don't know if I'm even in the ballpark. Thanks!

    Read the article

  • jquery / javascript for a user to select 1 of n images

    - by TesterTurnedDeveloper
    I want to display a few images (probably 5 max) and have a user click to select one. First thing I tried was radio buttons and putting the images inside labels. <input type="radio" name="BackgroundId" id="BackgroundId" value="1" /> <label for="BackgroundId"><img src="../../Content/images/thumb_1.jpg" /></label> Firefox will select the radio button when the user clicks the image, but IE doesn't. Is there a jquery plugin that will make the images clickable? Fancy-form looks like something I could use, but it isn't jquery and I've already got jquery in my project. Or can someone point me to a better way of selecting a single image?

    Read the article

  • Will_paginate Plugin on two objects on same page

    - by piemesons
    Hello I am using will_paginte plugin on two objects on a same page. Like on stackoverflow. There is a profile page on which there is a pagination on two things QUestions and answers. I am having problem ie:-- when user is clicking on questions pagination page 2. answers page are also updating. The reason is both is sending a post variable ie params[:page] How to change this variable so that only one should be updated. and how to maintain that user should not lose the other page. ie he is on 3rd page of questions and 1st page of answers and now he click on 5th page of the questions the result should be 3rd page of questions and 5th page of answers.

    Read the article

  • Jquery loads only after F5 in IE

    - by khushi
    I am using Jcrop jQuery to crop image in MVC3 application. following is my javacript function: jQuery(function ($) { $('#imgLab').Jcrop( { onChange: showCoords, onSelect: coordsSelected, onRelease: clearCoords } ); }); Image ID is 'imgLab'. Image src path is coming from database. Now this work fine in FF,Safari and Chrome. but in IE it only works after I press F5. Can anyone tell me what is wrong in code? Thanks in Advance. Khushbu

    Read the article

  • Anyway to error check PHP in Dreamweaver?

    - by user60310
    I do all my PHP coding in Dreamweaver (currently version CS3) I am used to it and like it. There is one thing I would like though, is to be able to check for errors. Currently I don't see them until I upload the page to a server. Is there anyway to setup PHP error checking in Dreamweaver? Thanks.

    Read the article

  • How to repopulate DataTables when having lots of data?

    - by chobo2
    Hi I am using datatables jquery plugin. I now have to clear the entire datatable and populate it with new data on the fly(all done through ajax). So what I was thinking to do is when I need to do this. Destroy the datatable remove the data html call up the partial view that renders the table Rebind the datatable with jquery. However it seems that datatable has no destroy method. So I know you can set the datatable to do something with ajax but I am not sure how. My datatable just uses the dom way when the page is loaded. I don't want to use the "fnAddData" as I am not sure how to format this 2d array they want and I don't think this is the best option. I think the best option is some how render the partial view back and use there ajax plugin. But I am not sure where that is or how to use it(I know it exists but that's about it). Thanks

    Read the article

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