Hey,
anyone knows a jQuery plug-in for text zoom a-la MAC OS X "Large Type" function in Address Book? I'd use it for the same situation - to show full-screen phone number after clicking on it.
Cheers
Hi,
let's consider a small method:
int MyFunction(string foo, int bar)
{
...
}
and some calls:
MyFunction("",0)
int x = MyFunction(foo1,bar1)
How would you explain this to a non-technical persons? Has anybody a nice metaphor?
I tried to explain method calling (or function application) several times, but I failed. Seems I can't find the right words here.
Regards,
forki
I'm have some that uses jQuery.clone() to get the html of a page and then add it to a pre tag. It works correctly in Firefox and Chrome, but nothing happens in IE:
<!DOCTYPE html>
<html>
<head>
<script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<script>
$(function(){
$('button').click(function(){
var $clone = $('html').clone();
$('#output').text($clone.html());
});
});
</script>
<style>
article, aside, figure, footer, header, hgroup,
menu, nav, section { display: block; }
</style>
</head>
<body>
<button>run test</button>
<pre id="output"></pre>
</body>
</html>
Is there any know bug with IE that prevents this, or am I doing something wrong?
(I need to clone it because I'm doing some changes to it before outputting it)
I'm looking for a way to programatically select all the content inside a TinyMCE editor instance.
The reason I need this is that I'd like it if all the text inside the editor was selected, as soon as someone clicks on it (I'm using TinyMCE in conjunction with JEditable, by the way).
Thanks,
Edan
Every time a user registers to our site we need to show a non-disclosure agreement. In order to continue the user has to accept it. My issue is that I have the NDA in all one page and the user does not really read it and accept (like we all do).
What I want is to make sure the user reads the NDA and accepts it one he "read" it?
What I have now is a simple jqeury validation if the user checks a box and click on accept. then it goes to the next page.
Here's what i have
<script>
$(document).ready(function() {
$('#go').click(function() {
// check if checkbox is check and go to next page
});
});
</script>
<div>
full nda
<hr>
<input type=checkbox> <input type=button value=go id=go>
</div>
Thanks
Hi,
I've got this "object-stack"
- Window
--- Grid (VerticalAlignment = Stretch)
----- Border (VerticalAlignment = Stretch OR Top)
The Border a primitive UserControl right now to keep things simple for me.
I'd like to be able to use the VisualStateManager to toggle the VerticalAlignment-property of the Border, so that the "Normal-state" equals VerticalAlignment.Top and "Expanded-state" equals VerticalAlignment.Stretch.
Is this possible?
Also, I'd like to use an easing function, when swithing between the two states.
Consider the following code:
var Widget = new Class({
Implements: [Options],
options: {
"name" : "BaseWidget"
},
initialize: function(options) {
alert("Options are: " + JSON.stringify(options)); //alerts "Options are: undefined"
this.setOptions(options);
alert("My options are: " + JSON.stringify(this.options)); //alerts "My options are: { 'name' : 'BaseWidget' }"
},
getName: function() {
return this.options.name;
}
});
var LayoutWidget = Widget.extend({
initialize: function() {
this.parent({ "name" : "Layout" });
}
});
alert(new LayoutWidget().getName()); //alerts "BaseWidget"
I am having difficulty in determining why the argument passed in the "this.parent()" call in "initialize" function of LayoutWidget is coming through as "undefined" in the initialize function of Widget.
I am using MooTools 1.2.2. Would somebody be able to point me in the right direction?
I always had this question:
When i dont mind the exact floating number
Which one is preferred?
like this code:
parseFloat
someValue = parseFloat(el.outerWidth())+parseFloat(ele2.css("marginRight")),
parseInt
someValue = parseInt(el.outerWidth(), 10)+parseInt(ele2.css("marginRight"), 10),
Which method is easier for the JS engine?
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.
When the page load, I expected <option value="B">B</option> value to change to red. It didn't work. Why?
jQuery
$(document).ready(function () {
$('[name=HeaderFields] option[value="B"]').val('red');
}
Dropdown:
<select name="HeaderFields" style="width:60px">
<option value="A">A</option>
<option value="B">B</option>
<option value="C">C</option>
</select>
I am using Heroku with a Ruby on Rails application, and running from Safari. I have the following Ajax call:
$.ajax({
type : 'POST',
url : '/test_page',
data : {stuff: arr1},
dataType : 'script'
});
arr1 is supposed to be an array of objects. There's a console.log right before that, and it is:
[Object, Object, Object, Object, Object, ...]
However, I got an error on the server side when I made this ajax call. The logs showed
2012-10-01T03:13:34+00:00 app[web.1]: Parameters: {"stuff"=>"[object Object]"}
2012-10-01T03:13:34+00:00 app[web.1]: WARNING: Can't verify CSRF token authenticity
2012-10-01T03:13:34+00:00 app[web.1]: NoMethodError (undefined method `to_hash' for "[object Object]":String):
2012-10-01T03:13:34+00:00 app[web.1]: Completed 500 Internal Server Error in 1ms
I'm unable to replicate the error. It's really confusing to me - what would cause that string to sometimes be passed to the server instead of the object?
Aspxcombobox populating on the fly works fine with IE, but with others browsers, when using arrow keys for navigation, the second depended control, always has value for the first next and not for the current, so I have a bit of delay ...
Breakpoints are great when one knows where the code is being executed. However, I have a problem where my DIV is being manipulated by some unknown code in a library I'm using. Is there a way to basically set a breakpoint on the node and see when children are added or attributes changed?
I have two divs of fixed length as of now, which loads external URL by dynamically embedding iframes inside them. Divs are appearing next to each other - one on left and other right.
As of now, I have fixed their width to 50% each. But, I want to give user a flexibility to increase the width of any div to view the URL inside easily without scrolling horizontally. Something like dragging the border separating the two divs to either left or right according to his need.
Is there a way I could achieve this? Please suggest any library or something.
I have gone through a library twentytwenty which is used for images. I don't know how will that work for dynamic iframes.
Here is the JSFiddle which displays the divs.
<div>
<div id="originalPage" style="width:54%;height: 730px;float:left">
<p>one div </p>
</div>
<div id="diffReport" style="width:45%; height: 730px;float:right">
<p>another div</p>
</div>
</div>
I am learing using jquery ajax to hander the JSON..i writre a demo code.
HTMLCODE
$(function () {
$("#add").click(function () {
var json = '{ "str":[{"Role_ID":"2","Customer_ID":"155","Brands":"Chloe;","Country_ID":"96;"}]}';
$.ajax({
url: "func.aspx/GetJson",
type: "POST",
contentType: "application/json",
dataType: 'json',
data: json,
success: function (result) {
alert(result);
},
error: function () {
alert("error");
}
});
});
});
<div>
<input type="button" value="add" id="add" />
</div>
i got a input and bind a script function to it, now the proble is comeing..
my C# functiong like that.
[WebMethod]
public static string GetJson(object str)
{
return str.ToString();//good for work
}
[Serializable]
public class TestClass
{
public TestClass()
{
}
public TestClass(string role_id, string customer_id, string brands, string countryid)
{
this.Role_ID = role_id;
this.Customer_ID = customer_id;
this.Brands = brands;
this.Country_ID = countryid;
}
public string Role_ID { get; set; }
public string Customer_ID { get; set; }
public string Brands { get; set; }
public string Country_ID { get; set; }
}
when i user
public static string GetJson(object str)
everything is so good.~~ no error at all
but . when i try to use my own class TestClass.
firebug tell me that
"Type 'TestClass' is not supported for deserialization of an array."
.any body can give me help:XD
WCAG 2.0 is released should we follow only WCAG 2.0 guideline or we should combination of both no need to consider WCAG 1.0 now?
or if I'm considering WCAG guideline then do i need to consider any other guideline along with WCAG like RNIB, DDA, Section 508 etc. or if I'm already considering WCAG guideline then no need to look at other region specific guideline/act etc.
Hi, I want to use sIFR 3 to add a simple linear gradient filter to a text, I can't find this in the ducumentation hope you guys can give me some help.
I found an article that show's how to do this but requiers the modification of the flash file and that's not what I want to do.
I looked in the sIFR documentaion and I didn't found a Gradient filter, I hope this effect can be made simple using the sIFR filters.
Thank's
I already read many article about this issue in here, SO.
I just want to discuss how to do it. NOT the moral issue.
--
for example.
at the google search webpage.
before I click the link, the link does not indicate the google url.
but After I click the link with shift-key, the url on the status bar is changed.
this mean the google webpage indicate 'Fake URL'.
the google compressed script is too difficult to read and analyze.
#
edited
The second url should work on ie8 even if I click with ctrl key.
I've read this SO post which led me to this FB policy page, which seemed to include some pertinent information, but I'd like more of a community response, maybe some experienced FB API people who know the limits.
My question is if I can use Facebook's Login api to, essentially, create a new user on my website. I really would just like to allow users to easily "transfer" some data from FB in order to more easily create a new account on my site.
I realize, first and foremost, that I would obviously announce to the user that by click "submit" in the form, that they are creating a separate account on my site.
Pertinent blocks on the policy page state:
You may cache data you receive through use of the Facebook API in order to improve your application’s user experience, but you should try to keep the data up to date. This permission does not give you any rights to such data.
Which doesn't look good for me, but also this:
If you stop using Platform or we disable your application, you must delete all data you have received through use of the Facebook API unless: (a) it is basic account information; or (b) you have received explicit consent from the user to retain their data.
Which, in my case, I would be satisfying part B. I would be asking the user's permission to retain the data, as I am simply using Facebook as a conveience to the user when creating an account.
I also realize that Facebook has a registration API, but this would require a Facebook styled login form, along with my own sites login form, and I'd rather one interface, as this makes it easier for me on the front and back end.
Any thoughts?
This might seem like a stupid easy question to some of you, but i'm new to jquery and can't get my datepicker to work like it should.
This is my textbox where the datepicker is attached to:
<asp:TextBox runat="server" ID="StartMonth" AutoPostBack="true" class="month-picker" />
and here is how i attach the datepicker. (I have multiple TextBoxes where the datepicker should be attached to, so i used the class attribute instead of the id.)
$(".month-picker").datepicker({ dateFormat: 'MM yy', changeYear: true, yearRange: '-9:+9' });
What i want to archive is when i click into the textbox where the text is "August 2012" it should set the pre-selected date of the datepicker to this date.
Can anyone help?
Kind regards.
I have a series of <div/>'s as follows:
<div>.co.uk</div>
<div>.com</div>
<div>.gb.com</div>
<div>.uk.com</div>
<div>.net</div>
How do I select just the divs containing .co.uk, .com, .net.
If I use:
$('div:contains(".co.uk"), div:contains(".com"), div:contains(".net")`)
This causes the .gb.com and .uk.com divs to be selected as well.
I am creating autocomplete functionality on an input tag using following code.
$('.query').autocomplete({
serviceUrl:'http://localhost/main/finder.php',
minChars:2,
delimiter: /(,|;)\s*/, // regex or character
maxHeight:400,
width:400,
zIndex: 9999,
deferRequestBy: 0, //miliseconds
onSelect: function(value, data){
}
});
Now the problem is my input element is added dynamically so for first input tag autocomplete is working but when i add one more input tag then it fails for the second one.
so i need some facility that live() provide in jquery ...
please do post the solution