I am writing a firefox extension that interacts with a JSON server interface. I receive a url to the server which then redirects to the client site that provides the cookie. I need to be able to set this cookie in the users browser without physically loading it in the browser. Is this possible through an AJAX call?
I tried using a hidden iframe, however firefox does not seem to like a php redirect in the iframe. My current solution is to load the site in a second tab that never gains focus and then auto close it when the cookie is set. This is very messy and would prefer something more streamlines.
Any thoughts?
I'm using jquery.qTip on http://comps.gunnjerkens.com/phws/services/
Looks beautiful with the drop shadow and rounded borders in modern browsers...unfortunately the drop shadow is lost on IE. So I want to specify an IE-only rule that makes the border a different color than white. Here's how I currently have it setup:
$(this).qtip({
content: the_content,
position: {
corner: {
target: 'bottomLeft',
tooltip: 'topLeft'
},
adjust: {
screen: true
}
},
style: {
border: {
radius: 4,
color: '#FFFFFF'
},
color: '#7D9240'
}
}); // qtip()
});
I appreciate any help!
IE7/Windows XP
I have a third party component in my page that does a lot of DOM manipulation to adjust itself each time the browser window is resized.
Unfortunately I have little control of what it does internally and I have optimized everything else (such as callbacks and event handlers) as much as I can. I can't take the component off the flow by setting display:none because it fails measuring itself if I do so.
In general, does setting visibility of the container to invisible during the resize help improve DOM rendering performance?
Most popular browsers, while rendering an image, they display it line-by-line top-to-bottom as it loads.
I have a requirement that a wait gif should be displayed while the image is loading.
When the image is fully loaded then it should be displayed instead of the wait gif.
I have a jQuery ajax function that retrieves JSON data. In the success block I call another function to parse the data and update the page. At the end of this parsing/updating function a different ajax call is made. This works perfectly in all browsers except Internet Explorer (7 and 8). The problem is Internet explorer thinks the script is taking too long to process because the success block from the first ajax call doesn't complete until the 2nd ajax call finishes.
I get the message:
"Stop running this script? A script on this page is causing your web browser to run slowly. If it continues to run, your computer might become unresponsive."
My jQuery code:
$("#id_select").bind("change", function(e){
$.ajax({
url: "/retrieve_data.js",
data: {id:$(e.target).children(":selected").attr("value")},
type: "get",
dataType:"json",
success: function(data, status, form){
processData(data);
},
error: function(response, status){
alert(response.responseText);
}
});
})
Any suggestions on how to get IE to stop timing out or to accomplish this task without rewriting all my jQuery functions would be appreciated.
This question is similar to http://stackoverflow.com/questions/161686/gwt-table-that-supports-sorting-scrolling-and-filtering
However I would prefer open source and I am looking for snappy performance. I want a good way to perform dynamic filtering on rows.
SmartGWT's adaptive filter looks interesting. http://www.smartclient.com/smartgwt/showcase/#grid_adaptive_filter_featured_category
Anyone have any experience with this?
Hello SO,
I would like to have a confirmation on some point.
My goal is to always get the same string (which is the URI in my case) while reading the href property from a link. Example:
<a href="test.htm" /> with base_url = http://domain.name/
<a href="../test.htm" /> with base_url = http://domain.name/domain/
<a href="http://domain.name/test.htm" /> with base_url = any folder from http://domain.name/
I need to get http://domain.name/test.htm from the 3 situations above (or any other identical string).
After some tests, it appears that my_a_dom_node.href always return the full-qualified URI, including the http://domaine.name, which should be okay for what I want.
jQuery has a different behaviour and $(my_a_dom_node).attr('href') returns the content (text) that appears inside the HTML. So my trick is to use $(my_a_dom_node).get(0).href to get the full URI.
The question is: can I rely on this?
Hi,
I am loading my tinyMCE inside my jquery document ready function. It is loaded in advanced mode, and I am also setting my toolbar to appear aligned 'left'. However this is still not appearing the way I imagine it should. What could be the problem?
I have found many ways to measure width and to truncate text using jquery, but I can't find one based on height.
I am limited to two lines of text or it will knock my design out of canter.
So does anyone know a method of limiting a paragraph to two lines high, tuncating it and adding an elipse ?
Hey,
I have an input text :
<input name="Email" type="text" id="Email" value="[email protected]" />
I want to put a default value like "What's your programming question ? be specific." in StackOverFlow, and when the user click on it the default value disapear.
Hi,
I am looking for a little bit of JQuery or JS that allows me to produce a horizontally scrolling "news ticker" list.
The produced HTML needs to be standards compliant as well.
I have tried liScroll but this has a habit of breaking (some content ends up on a second line at the start of the scroll), especially with longer lists.
I have also tried this News Ticker but when a DOCTYPE is included the scrolling will jolt rather than cycle smoothly at the end of each cycle.
Any suggestions are appreciated.
Edit
So thanks to Matt Hinze's suggestion I realised I could do what I wanted to do with JQuery animate (I require continuous scrolling not discrete scrolling like the example). However, I quickly ran into similar problems to those I was having with liScroll and after all that realised a CSS issue (as always) was responsible.
Solution: liScroll - change the default 'var stripWidth = 0' to something like 100, to give a little space and avoid new line wrapping.
I'm using FeinCMS (https://github.com/feincms/feincms/) and django-ckeditor with file upload support (https://github.com/shaunsephton/django-ckeditor).
I create a FeinCMS content type for RichTextField:
class RichContent(models.Model):
text = RichTextField(_('text'))
class Meta:
abstract = True
verbose_name = _('Rich Text')
verbose_name_plural =_('Rich Text')
def render(self, **kwargs):
context_instance = kwargs.get('context_instance')
return render_to_string('content/page/rich_content.html', {
'page': self,
}, context_instance=context_instance)
But in Django admin, when i select 'Rich Text' and press 'Go', get this error in firebug console:
uncaught exception: [CKEDITOR.editor] The instance "id_richcontent_set-__prefix__-text" already exists.
And textarea in ckeditor do not editable.
I am using nicEdit editor and i have added my own custom image resizing script to it. But i want to disable the default _moz_resizing that appears in firefox.
I wanted to have finer control over the image being resized. ( Eg: Allow only the image to resize and inherit the width of the parent container. )
So i wrote a custom script. But since firefox has its own image resizing control (_moz_resizing) how do i disable it? If there is no way to do so, i have a very simple workaround where i browser detect firefox and turn off my custom script and use the _moz_resizing instead.
But i won't have fine grained control and will have to rely on there being now browser bugs in firefox. :(
I have a Kendo grid that has links, which I also set to selectable, snippet here:
columns: [{
field: 'link', title: 'Link',
template: '<a href="${link}">Click Here</a>'
}],
...
selectable: 'row',
change: function(e) {
var rowUid = this.select().data('uid');
rowDs = this.dataSource.getByUid(rowUid);
console.log('Went (1): ' + rowDs);
return false;
}
When I click on the external link <a>, I also select the row. Is there any way to suppress the selectable event?
I've been struggling with a feature I've been trying to create for sometime.
The idea here is that the user sees the little thumbnail + headline, as well as the Posted By information. They can then click on the headline to expand to the article or click on the "Comments" link to expand directly to the comments made on the article. Or, if they want they can view comments by clicking on the headline(to expand to the article), then click on View Comments (to expand to the comments). In the end, a modular yet flexible and functional open/close system to view latest news.
Here is what I've been working on: (I put all my code in one place so its easier on whomever may look at this to view) http://notedls.com/pointtest.html
This is what I'm shooting for, but it's far from what I want ;(
It's using the jQuery 1.6 plugin, which 1.8 is out but I'm far from being a master or expert at this and I don't think I could build from the ground up. I've already edited this plugin to get it to work like this, but as you can see, the AUTHOR and Comments start making shit hit the fan ;; It's because the code is calling the "A TAG" for the header; which is the headline.
Does anyone know any easier way to achieve what I'm envisioning or possible a way to fix this current code? I'm pretty desperate at this point ;;
I have jQuery to select all font elements that are children of the element with id="right" within the html stored in the var html... when I do an alert to see how many elements it gets:
alert($("#right > font", html).length);
it gives me an alert of: 5
but when I try any of the following, I don't get any alerts...
alert($("#right > font", html)[0].html());
alert($("#right > font", html)[0].text());
alert($("#right > font", html)[0].val());
Any Ideas?
Thanks,
Matt
When using Googles geocoder service to display a city on a map; filling out a non-existing city results in an error.
Is there a way to display some suggestions based on the filled out city?
var geocoder = new GClientGeocoder();
function showAddress(address, zoom) {
geocoder.getLatLng(
address,
function(point) {
if (!point) {
//no point found....
//Suggest some points :)
} else {
map.setCenter(point, zoom);
}
}
);
}
showAddress('Someplace, Nederland', 14);
When i write a jQuery plugin i like to specify options for spacings the CSS way.
I wrote a function that returns a CSS String as values in a object.
5px 10px returns top: 5px, right: 10px, bottom: 5px, left: 10px
Now i often use the returned values to do some calculations and its not very nice to have to extract the measuring unit every time...
I suck in writing regular expressions could someone help me complete this function:
this.cssMeasure = function(cssString, separateUnits){
if ( cssString ){
var values = {}
}else{
return errorMsg
}
var spacing = cssString.split(' ')
var errorMsg = 'please format your css values correctly dude'
if( spacing[4] || (spacing[2] && !spacing[3]) ) {
return errorMsg
} else if ( spacing[3] ) {
values = {top: spacing[0], right:spacing[1], bottom:spacing[2], left:spacing[3]}
} else if ( spacing[1] ) {
values = {top: spacing[0], right:spacing[1], bottom:spacing[0], left:spacing[1]}
} else {
values = {top: spacing[0], right:spacing[0], bottom:spacing[0], left:spacing[0]}
}
if (separateUnits) {
$.each(values, function(i, value){
/*
at this place i need to extract the measuring unit of each value and return them separately
something like top: {value: 10, unit: 'px'}, right: {bla} and so on
*/
})
}
return values
}
if you have any idea how to improve this function i am open to your comments.
I have image and txt file of same size say 200 KB.
Now i would like to calculate the time to download the image and text of text file.
Now my question is adding image to DOM and and then calculating time on onload and requesting content of txt file using Ajax will they take same time or due to image and xml they will take different time ? why ?
Is there any way to launch a JS function after a dataGrid launches its ItemDataBound event?
I've tried adding a JS block to the ItemDataBound function like:
protected void itemDataBound (e sender, arguments args)
{
ClientScript.RegisterStartupScript(typeof(string),"test","alert('testing');",true);
}
but it did nothing.
Am I missing something?
Hi,
I have a data fetching method that uses jQuery.ajax() to fetch xml files.
/* */data: function() {
/* debug */try {
var url = arguments[0] ;
var type = arguments[1] ;
var scope = arguments[2] ;
var callback = arguments[3] ;
var self = this ;
if(this.cache[url]) {
callback(this.cache[url]) ;
} else if(!this.cache[url]) {
$.ajax({
type: "GET" ,
url: url ,
dataType: type ,
cache: false ,
success: function(data) {
if(type == "text/xml") {
var myJson = AUX.json ;
var jsonString = myJson.build(data,scope,null) ;
var jsonObject = $.parseJSON(jsonString) ;
self.cache[url] = jsonObject ;
callback(url) ;
} else if(type == "json") {
self.cache[url] = data ;
callback(url) ;
}
} ,
error: function() {
throw "Ajax call failed." ;
}
}) ;
}
/* debug */} catch(e) {
/* debug */ alert("- caller: signTutor.data\n- " + e) ;
/* debug */}
} ,
My problem is: jQuery somehow adds a parameter (?_=1272708280072) to the url if there are escaped (hexadecimal notation) or unescaped utf-8 characters outside of the ASCII range -- i believe -- in the file name. It all works well if the file name does not contain characters in that range.
Type is set to xml so there should not be a confusion of types. Headers of the xml files are also set adequately.
I can see from the console that jQuery throws an error, but I'm not sure as to where the problem really is.
Probably a problem with file name formatting, but I did not find any resources on the web as to AJAX file name specifications. Any ideas?
Thanks for you help!
I am looking for an algorithm to wrap text within a non-rectangular shape, preferably based on the Knuth and Plass algorithm. The hardest part of this is that the lines may have different heights due to differing font sizes in the text. The image below is an example of what the algorithm should be able to generate.
Thanks for any help!