I have seen some websites stream avi videos from megaupload using divx web player. How would I do this for my site?
Are there open source scripts to do this? How would I get started?
I have a div containing jQuery image slideshow, i want to put another div/layer on top of the slideshow. Is it possible? Is it as simple as setting both div z-index css property?
My JSON looks like this:
{
"[email protected]":"Person1",
"[email protected]":"Person65",
"[email protected]":"Person24"
}
It's returned in various number of elements, and various keys. How do I traverse the data if my code is like this:
$.post("includes/ajax.php", {
group_id : $('#group').val()
}, function(data) {
//how do i traverse data here?
}, "json");
Any help will be appreciated :)
Thanks!
A web application I'm helping to develop is faced with a well-known problem: we want to be able to let users know of various events and so forth that can occur at any time, essentially at random, and update their view accordingly. Essentially, we need to allow the server to push requests to individual clients, as opposed to the client asking the server.
I understand that WebSockets are an effort to address the problem; however, after a bit of looking around into them, I understand that a) very few web browsers currently offer native websocket support; b) to get around this, you either use flash sockets or some sort of AJAX long-polling; c) a special websockets server must be used.
Now, we want to offer our service without Flash. And any sort of servers must have some sort of load-balancing capabilities, or at least some software that can do load balancing for them.
As of 2008, everyone was saying that Comet-based solutions (e.g., Bayeux) were the way to go for these sort of situations. However, the various protocols seem to have not had much work put into them since then—which leads (finally) to the question.
Is Bayeux-flavored Comet still the right tool for jobs like this? If not, what is?
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!
I am using jQuery's scrollTo plugin to scroll up and down my page, using UP arrow and DOWN arrow.
i have a bunch of div with class "screen", as so: <div class="screen-wrapper">...</div>
What I am trying to do is, when i press UP or DOWN, the window scrolls to the next, or previous div with class of "screen".
I have the keypresses taken care of.
According to the plugin docs, to scroll a window, you use $.scrollTo(...);
Here's the code I have:
$(document).keypress(function(e){
switch (e.keyCode) {
case 40: // down
n = $('.screen-wrapper').next()
$.scrollTo( n, 800 );
break;
case 38: // up
break;
case 37: // left
break;
case 39: // right
break;
}
});
And if it helps, here's the HTML div. I have a few of these on the page, and essentially, am trying to scroll to next one by pressing down arrow:
<div class='screen-wrapper'>
<div class='screen'>
<div class="sections">
<ul>
<li><img src="images/portfolio/sushii-1.png " /></li>
<li><img src="images/portfolio/sushii-2.png" /></li>
<li><img src="images/portfolio/sushii-3.png" /></li>
</ul>
</div>
<div class="next"></div>
<div class="prev"></div>
</div>
And also if it needed, I can provide a link where this is being used if it'll help someone get a better idea.
edit
And, i forgot to mention what the real question here is.
The question/problem is that it won't scroll down past the first element, as seth mentioned.
I have a page when, if the user is near the bottom of the page, loads the next page.
I just recently switched it to jQuery, and now use the jQuery.ajax() function to get the data. However, now i cannot check if the xhr is already loading, making the page load multiple xhrs when the user near the bottom.
My listener is:
$(document).scroll(function () {
if(/* scrollbar is near bottom */)
loadxhr(dat++); //function that calls jQuery.ajax()
}
});
Basically, can you track the readyState of the call in a global scope?
I have Windows Application (.EXE file is written in C and built with MS-Visual Studio), that outputs ASCII text to stdout. I’m looking to enhance the ASCII text to include limited HTML with a few links. I’d like to invoke this application (.EXE File) and take the output of that application and pipe it into a Browser. This is not a one time thing, each new web page would be another run of the Local Application!
The HTML/java-script application below has worked for me to execute the application, but the output has gone into a DOS Box windows and not to pipe it into the Browser. I’d like to update this HTML Application to enable the Browser to capture that text (that is enhanced with HTML) and display it with the browser.
<body>
<script>
function go() {
w = new ActiveXObject("WScript.Shell");
w.run('C:/DL/Browser/mk_html.exe');
return true;
}
</script>
<form>
Run My Application (Window with explorer only)
<input type="button" value="Go"
onClick="return go()">
</FORM>
</body>
input[disabled='disabled']
{
background-color:#FFFBF0;
color: #28B51D;
}
I am using this example but that is not run in iexplore.
But also run in other browsers.
If any body know then please tell me that how to change the color of disabled html control in iexplore.
I have a 700x300 background repeating seamlessly inside of the main content-div. Now I'd like to attach a div at the bottom of the content-div, containing a different background image that isn't repeatable, connecting seamlessly with the repeatable background above it. Essentially, the non-repeatable image will look like the end piece of the repeatable image.
Due to the nature of the pattern, unless the full 300px height of the background image is visible in the last repeat of the content-div's backround, the background in the div below won't seamlessly connect. Basically, I need the content div's height to be a multiple of 300px under all circumstances. What's a good approach to this sort of problem?
I've tried resizing the content-div on loading the page, but this only works as long as the content div doesn't contain any resizing, dynamic content, which is not my case:
function adjustContentHeight()
{
// Setting content div's height to nearest upper multiple of column backgrounds height,
// forcing it not to be cut-off when repeated.
var contentBgHeight = 300;
var contentHeight = $("#content").height();
var adjustedHeight = Math.ceil(contentHeight / contentBgHeight);
$("#content").height(adjustedHeight * contentBgHeight);
}
$(document).ready(adjustContentHeight);
What I'm looking for there is a way to respond to a div resizing event, but there doesn't seem to be such a thing. Also, please assume I have no access to the JS controlling the resizing of content in the content-div, though this is potentially a way of solving the problem.
Another potential solution I was thinking off was to offset the background image in the bottom div by a certain amount depending on the height of the content-div. Again, the missing piece seems to be the ability to respond to a resize event.
I am trying to load a webpage into a sample webview that I created:
public class HelloWebview extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
WebView webview;
webview = (WebView) findViewById(R.id.webview);
webview.getSettings().setDefaultZoom(ZoomDensity.FAR);
webview.setHorizontalScrollBarEnabled(false);
webview.setVerticalScrollBarEnabled(false);
webview.getSettings().setJavaScriptEnabled(true);
webview.loadUrl("http://10.0.2.2/index.html");
}
}
Initially, I had a problem with the scrollbars so I added the two lines to disable them. Now, I am still able to pan around the webpage though the scroll bars are not visible. How can I fix the view so that I am not able to pan (or scroll) the webpage? By panning, I mean moving around the webpage with an onTouch event.
Hi,
In w3c dom interface, there is DOMTreeWalker to traverse the DOM. I find this example which uses DOMTreeWalker:
http://www.java-tips.org/java-se-tips/org.w3c.dom/how-to-traverse-the-dom-tree-using-treewalker-2.html
But my question is How can I use the DOMTreeWalk to dump the dom structure and value to a file?
i.e. I need to know when a parent start and a parent end so that I can do when I dump the dom to a file (i need to insert after each parent dumps its children:
<parent>
<child a1="1" a2="2"/>
<child a3="1" a4="3"/>
<child a5="1" a6="5"/>
</parent>
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?
i am trying like this:
$(document).ready(function(){
$('#muestraMotor').bind('mousedown',function(){
var cssLink = document.createElement("link");
cssLink.href = "../estilo/css/datepicker.css"; cssLink .rel = "stylesheet";
cssLink .type = "text/css";
frames['cboxIframe'].document.body.appendChild(cssLink);
});
})
where cboxIframe is the id of the iframe,
Firebug jumps:
frames.cboxIframe is undefined
[Detener en este error] frames['cboxIframe'].document.body.appendChild(cssLink);
This is probably really stupid but i can't find the problem with my code. It fetches a url that returns json and the function is then supposed to return a string:
function getit() {
var ws_url = 'example.com/test.js';
var user = false;
$.getJSON(ws_url, function(data) {
alert('user '+data.user);//shows john
user = data.user || false;
}
);
return user;//should return john but returns false
}
test.js will have something like this:
{"id":"12","username":"ses","user":"john","error":""}
or like this:
{"error":"123"}
I also tried if(data.user){}else{} but it didn't work either..
So what am i missing?
Thanks :)
i make a demo using v2 , and now i want to using v3..
but i found v3 has not many method that v2 has,
ex:
1.map.enableGoogleBar();
2.map.enableScrollWheelZoom();
3.polyline.enableDrawing()
is v3 powerful enough ???
thanks
I have a form which I want to submit upon button click which is outside the form, here is my HTML :
<form id="checkin" name="checkin" id="checkin" action#" method="post">
<input type="text" tabindex="100" class="identifier" name="identifier" id="identifier">
<input type="submit" tabindex="101" value="Submito" class="elsubmito" name="submit">
</form>
Here is my jQuery :
$("button").live('click', function(){
$("#checkin").submit();
});
$("#checkin").live('submit', function(){
});
When I click submit button inside the form its submitting ok, but its not submitting when I click on the button which is outside the form tags, why? how can I fix this ?
I need to include multiple images in a canvas. I want to load them dynamically via a for-loop.
I tried a lot but in the best case only the last image is displayed. I check this tread but I still get only the last image.
For explanation, here's my latest code(basically the one from the other post):
for (var i = 0; i <= max; i++)
{
thisWidth = 250;
thisHeight = 0;
imgSrc = "photo_"+i+".jpg";
letterImg = new Image();
letterImg.onload = function() {
context.drawImage(letterImg,thisWidth*i,thisHeight);
}
letterImg.src = imgSrc;
}
Any ideas?
I've been tinkering around with the excellent Superfish drop-down menu to fit my needs. Here's the result. Still, there are two oddities I need to fix.
Since I changed the font family and font size used for the items in the menu bar, the drop-down menus are aligned incorrectly a few pixels lower than where they should be.
Secondly, when I hover over a menu item that has a submenu, an arrow to the right is displayed but it's not as visible as it should be due to the light background color. Can I change this quickly without making a new arrow image?
I've noticed that every time I use Google's Closure Compiler Service, it leaves a few unnecessary spaces in the compiled code presented on the right-hand side of the page. These correspond to line breaks in the hosted version of the compiled code.
For example (note the line breaks, each of which seems unnecessary):
http://troy.onespot.com/static/stack_overflow/closure_spaces.js
To date, I've just been removing them manually, but I'm curious why they're there. Is it to limit the line length of the hosted version of the code to make it more readable?
Could the compiler be smart enough to leave or insert those intentionally to maximize GZIP compression efforts?
I know that they have a trivial effect on the file size, but with so much effort going into minifying every last byte in the source script, it's counterintuitive why they're there.
I'm working on a project to develop a cross-browser testing web app. Simply put, I'm tired of having to maintain multiple browsers on the same system and IE in VMware solely for the purpose of testing. Does anyone know if there is any way to change the render kit programmatically? For example, if I insert a URL, I would be able to load the URL and switch the browser render within a frame of some assortment. I am experienced with PHP, JS, and RoR if there is a solution using any of those.
Thank you!
John
Hi,
folling this discussion and this link, I learnt that by adding document.domain = 'mydomain.com'; to the tinyMCE initializer file and tiny_mce_popup.js i can overcome the cross domain problem.
I haven't tested it on a proper production server, but in my dev environment the base domain is localhost:8000 and my static files (also tinyMCE ones) are on localhost:88.
Adding document.domain = 'localhost:8000'; or document.domain = 'localhost:88'; doesn't solve the problem as I get the following error:
Uncaught Error: SECURITY_ERR: DOM Exception 18
Any help?
Thanks
Hi There,
I have an an ajax request that looks like this,
$('input.fakecheck').click(function(){
alert("deleteing....");
$.ajax({
url:"/search",
type:"POST",
data: $(this).attr('name')+"="+$(this).attr('value')+"&remove=Remove",
success:function() {
alert(data);
}
})
})
This calls a php function which looks like this,
private function _remove_from_short_list($cv_array)
{
if (is_array($cv_array))
{
$short_list = $this->session->userdata('short_list');
$new_list = array_diff_key($short_list, $cv_array);
$this->session->set_userdata('short_list', $new_list);
}
}
Essentiallty what happens is that on my page I have a list which is essentially a list of id's taken out of the session, the user can then by click and input(this will change) delete the id from their session. However once the deletion has taken place I want to be able to refresh the list to show that it has taken place, currently nothing happens, until I manually refresh.